You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
When upgrading from 1.5.0 to 1.5.1 or newer, calling $httpBackend.flush() or scope.$apply() in test code causes the default route to resolve automatically. This can lead unexpected requests and break the tests. This seems to be due to change in ngRoute.
If the current behavior is a bug, please provide the steps to reproduce
Can be reproduced with for example AngularJS Phonecat demo by updating bower.json to use Angular 1.5.1 and running the tests.
The text was updated successfully, but these errors were encountered:
Hm...this can be indeed inconvenient 😕
Basically, this is caused by either specifying a / route ($routeProvider.when('/', ...)) or redirecting to some "fallback" route ($routeProvider.otherwise(...)).
It is possible to work around this (in several ugly ways). The two most straight-forward ways out are to either add a dummy template to the $templateCache or add an expectation for the template URL:
…usly loaded template"
This reverts commit 5e37b2a.
Eagerly loading `$route`, could break tests, because it might request the root or default route
template (something `$httpBackend` would know nothing about).
It will be re-applied for `v1.6.x`, with a breaking change notice and possibly a way to disable
the feature is tests.
Fixesangular#14337
…usly loaded template"
This reverts commit 5e37b2a.
Eagerly loading `$route`, could break tests, because it might request the root or default route
template (something `$httpBackend` would know nothing about).
It will be re-applied for `v1.6.x`, with a breaking change notice and possibly a way to disable
the feature is tests.
Fixes#14337
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Do you want to request a feature or report a bug?
Report a breaking change (or a bug).
What is the current behavior?
When upgrading from 1.5.0 to 1.5.1 or newer, calling
$httpBackend.flush()
orscope.$apply()
in test code causes the default route to resolve automatically. This can lead unexpected requests and break the tests. This seems to be due to change in ngRoute.If the current behavior is a bug, please provide the steps to reproduce
Can be reproduced with for example AngularJS Phonecat demo by updating bower.json to use Angular 1.5.1 and running the tests.
The text was updated successfully, but these errors were encountered: