Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
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

Description

@fantarama

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions