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.
Is there any reason why $httpBackend matches the first and not the last mock definition? If it worked the other way around (i.e. $httpBackend.when added new mock definitions to the beginning of definitions array instead of the end of it) it would be much easier to overwrite already mocked requests.
I've got some default mock definitions common for almost all tests that are loaded before each test and would like to be able to easily overwrite them in some specific tests.
I wanted to prepare PR that changes this, but there's even a unit test that explicitly checks for this behavior.
EDIT: In ngMock module unit tests like should match headers if specified or should match data if specified, the first mocks are more specific than the later ones. In a real app, I'd expect something opposite - one would create general mocks for most tests and then define more specific ones in selected tests.