0

私はjsファイルに以下のようなモジュールを持っています

app.js

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

単体テスト ケースを作成する場合、単体テスト ケースにモジュールをどのようにロードすればよいですか??

この通りか

module('app');

他の方法

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

モジュールをロードする正しい順序または正しい方法はどれですか...常に以下のエラーが発生します

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)
4

0 に答える 0