0

I have a module as below in a js file

app.js

 angular.module( 'app', [ 'ui.bootstrap', 'routes', 'module2', 'ngAnimate', 'ngSanitize' ] );

If i am to write a unit test case then how should i load the modules in my unit test case??

Is it this way

module('app');

Other way

module('ui.bootstrap');
module('routes');
module('module2');
module('ngAnimate');
module('ngSanitize');

Which is right order or the right way to load the module...As am always getting the below error

Error: [$injector:unpr] Unknown provider: deepakProvider <- deepak
 http://errors.angularjs.org/1.4.9/$injector/unpr?p0=deepakProvider%20%3C-%20deepak
     at C:/jasmine/InformedEnrollment2/src/webapp/informedenrollment2/webclnt/components/angular/angular.js:68:12
     at C:/jasmine/project/src/webapp/project/webclnt/components/angular/angular.js:4346:19
     at Object.getService [as get] (C:/jasmine/project/src/webapp/project/webclnt/components/angular/angular.js:4494:39)
     at C:/jasmine/project/src/webapp/project/webclnt/components/angular/angular.js:4351:45
     at Object.getService [as get] (C:/jasmine/project/src/webapp/project/webclnt/components/angular/angular.js:4494:39)
     at Object.<anonymous> (C:/jasmine/project/tests/DemoToTheTeam.js:20:47)
     at Object.invoke (C:/jasmine/project/src/webapp/project/webclnt/components/angular/angular.js:4535:17)
     at Object.workFn (C:/jasmine/project/node_modules/angular-mocks/angular-mocks.js:3071:20)
 Error: Declaration Location
     at window.inject.angular.mock.inject (C:/jasmine/project/node_modules/angular-mocks/angular-mocks.js:3033:25)
     at Suite.<anonymous> (C:/jasmine/project/tests/DemoToTheTeam.js:19:15)
     at C:/jasmine/project/tests/DemoToTheTeam.js:2:1
 TypeError: Cannot read property 'multiply' of undefined
     at Object.<anonymous> (C:/jasmine/project/tests/DemoToTheTeam.js:26:13)
50.0.2661 (Windows 7 0.0.0): Executed 7 of 7 (1 FAILED) (0.182 secs / 0.064 secs)
user2918673
  • 141
  • 1
  • 9
  • Please do not ask same question multiple times. I've just answered your previous question. Have a look at it. – SiddAjmera Jun 14 '16 at 06:26
  • Hoping to make my doubts clear and get it clarified thats y... – user2918673 Jun 14 '16 at 06:30
  • @SiddAjmera : I have an issue in getting ctrl data to test can you please look into and help on it. https://stackoverflow.com/questions/53629138/how-to-test-and-resolve-controller-data-then-function-promise-and-get-orgin – Ajay.k Dec 07 '18 at 09:14

0 Answers0