Open madflow opened 7 years ago
This would probably be solved by including $qProvider.errorOnUnhandledRejections(false);
in the spec file. I'll see if I have time to look at it, but a PR would be welcome!
Apparently there are also some breaking changes about JSONP requests in Angular 1.6. https://code.angularjs.org/1.6.1/docs/api/ng/service/$http#jsonp
I get the following errors with Angular 1.6.1
FAILED TESTS:
Restangular
JSONp
✖ should work for get
PhantomJS 2.1.1 (Mac OS X 0.0.0)
Error: Unexpected request: JSONP /accounts/1?callback=JSON_CALLBACK
Expected JSONP /accounts/1 in https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular-mocks.js (line 1421)
$httpBackend@https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular-mocks.js:1421:90
sendReq@https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.js:12155:21
serverRequest@https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.js:11908:23
processQueue@https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.js:16648:39
https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.js:16692:39
$eval@https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.js:17972:28
$digest@https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.js:17786:36
flush@https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular-mocks.js:1813:45
test/restangularSpec.js:519:25
loaded@http://localhost:9876/context.js:151:17
✖ should work for getList
PhantomJS 2.1.1 (Mac OS X 0.0.0)
Error: Unexpected request: JSONP /accounts?callback=JSON_CALLBACK
Expected JSONP /accounts in https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular-mocks.js (line 1421)
$httpBackend@https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular-mocks.js:1421:90
sendReq@https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.js:12155:21
serverRequest@https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.js:11908:23
processQueue@https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.js:16648:39
https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.js:16692:39
$eval@https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.js:17972:28
$digest@https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.js:17786:36
flush@https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular-mocks.js:1813:45
test/restangularSpec.js:527:25
loaded@http://localhost:9876/context.js:151:17
headers
✖ should pass uppercase methods in X-HTTP-Method-Override
PhantomJS 2.1.1 (Mac OS X 0.0.0)
Possibly unhandled rejection: {"status":0,"config":{"method":"POST","transformRequest":[null],"transformResponse":[null],"jsonpCallbackParam":"callback","headers":{"X-HTTP-Method-Override":"PUT","Accept":"application/json, text/plain, */*","Content-Type":"application/json;charset=utf-8"},"url":"/overriders/1","data":{"id":1}},"statusText":""} thrown
On the theme of JSONP for AngularJS V1.6 https://stackoverflow.com/questions/42706549