How to overwrite already mocked request when using e2e $httpBackend?

16 views
Skip to first unread message

Szymon Nowak

unread,
Apr 16, 2015, 11:15:28 AM4/16/15
to ang...@googlegroups.com
Hi,

what's the easiest/cleanest way to overwrite already mocked request? 

Currently when a new mock is added via ".when" method, it's added to the end of definition list (https://github.com/angular/angular.js/blob/g3_v1_4/src/ngMock/angular-mocks.js#L1251) and when checking if there's a match, it starts iterating over definition list from the beginning (https://github.com/angular/angular.js/blob/g3_v1_4/src/ngMock/angular-mocks.js#L1191). Wouldn't it make more sense to either add new mocks to the beginning of this list or iterate it from the end, so that mocks added later would be checked first?
Reply all
Reply to author
Forward
0 new messages