Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Angular-mock 1.6.2 $httpBackend injection error #15773

Closed
fantarama opened this issue Mar 3, 2017 · 1 comment
Closed

Angular-mock 1.6.2 $httpBackend injection error #15773

fantarama opened this issue Mar 3, 2017 · 1 comment

Comments

@fantarama
Copy link

fantarama commented Mar 3, 2017

I've update to the new 1.6.2 version and all unit-test that inject $httpBackend mock service now fail with this exception:

TypeError: Cannot read property 'callbacks' of undefined
	at $jsonpCallbacksProvider.$get (../src/test/webapp/lib/angular.js:13103:36)
	at Object.invoke (../src/test/webapp/lib/angular.js:4862:19)
	at ../src/test/webapp/lib/angular.js:4656:37
	at getService (../src/test/webapp/lib/angular.js:4803:32)
	at injectionArgs (../src/test/webapp/lib/angular.js:4828:58)
	at Object.invoke (../src/test/webapp/lib/angular.js:4854:18)
	at $HttpBackendProvider.origProvider.$get (../src/test/webapp/lib/angular.js:4729:43)
	at Object.invoke (../src/test/webapp/lib/angular.js:4862:19)
	at ../src/test/webapp/lib/angular.js:4656:37
	at getService (../src/test/webapp/lib/angular.js:4803:32)
Error: Declaration Location
	at window.inject.angular.mock.inject (../src/test/webapp/lib/angular-mocks.js:3133:25)
	at Suite.<anonymous> (../src/test/webapp/app/checkout/checkoutOrderCtrlTest.js:12:16)
	at ../src/test/webapp/app/checkout/checkoutOrderCtrlTest.js:1:1
Chrome 56.0.2924 (Windows 7 0.0.0) checkoutOrder controller should redirect to ** FAILED
TypeError: Cannot read property 'callbacks' of undefined
	at $jsonpCallbacksProvider.$get (../src/test/webapp/lib/angular.js:13103:36)
	at Object.invoke (../src/test/webapp/lib/angular.js:4862:19)
	at ../src/test/webapp/lib/angular.js:4656:37
	at getService (../src/test/webapp/lib/angular.js:4803:32)
	at injectionArgs (../src/test/webapp/lib/angular.js:4828:58)
	at Object.invoke (../src/test/webapp/lib/angular.js:4854:18)
	at $HttpBackendProvider.origProvider.$get (../src/test/webapp/lib/angular.js:4729:43)
	at Object.invoke (../src/test/webapp/lib/angular.js:4862:19)
	at ../src/test/webapp/lib/angular.js:4656:37
	at getService (../src/test/webapp/lib/angular.js:4803:32)
Error: Declaration Location
	at window.inject.angular.mock.inject (../src/test/webapp/lib/angular-mocks.js:3133:25)
	at Suite.<anonymous> (../src/test/webapp/app/checkout/checkoutOrderCtrlTest.js:12:16)
	at ../src/test/webapp/app/checkout/checkoutOrderCtrlTest.js:1:1
Chrome 56.0.2924 (Windows 7 0.0.0): Executed 1 of 1 (1 FAILED) ERROR (0.379 secs / 0.031 secs)
03 03 2017 09:58:49.347:INFO [watcher]: Removed file "../src/test/webapp/app/checkout/checkoutOrderCtrlTest.js".

I've removed the $httpBackend injection (and commented related test lines code) and test pass.

By now I've rollback to angular-mock 1.6.1

@gkalpak
Copy link
Member

gkalpak commented Mar 3, 2017

This is a duplicate of #15685 and has been fixed with #15686.
The fix will be included in the upcoming 1.6.3 release.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants