I'm using backbone for a project in which I manually rewrite the URL in the browser using app.router.navigate()
.
I want to be able to test this behaviour with jasmine. I've used expect(Backbone.history.fragment.endsWith()).toBeTruthy();
and expect(document.URL.endsWith()).toBeTruthy();
to test this.
When I run Jasmine test on my own browser, everything is
ok but when these tests automatically run on Travis CI, they fail saying
document.URL
or Backbone.history.fragment
is undefined. Why does it do that ?