6
角度サービスを注入しようとするたびに、簡単なジャスミンテストが失敗します。しかし、私は注射を削除すると、それは動作します。次は、エラーがスローされます:angle before単純なテストが失敗する原因となります。
describe('rule.js file', function() {
beforeEach(module('myModule'));
beforeEach(inject(function($controller) {
console.log('What the heck is wrong???: ' + $controller);
}));
it('foo should be equal to 1', function() {
expect(1).toBe(1);
});
});
PhantomJS 2.1.1 (Windows 7 0.0.0) rule.js file foo should be equal to 1 FAILED
しかし、私はそうのような注入ラインコメントアウトした場合:
describe('rule.js file', function() {
beforeEach(module('myModule'));
it('foo should be equal to 1', function() {
expect(1).toBe(1);
});
});
テストに合格します。
誰かが間違っている可能性について何か手掛かりがありますか?
編集:ここに私のkarma.confはファイル
'bower_components/angular/angular.js',
'bower_components/angular-animate/angular-animate.js',
'bower_components/angular-aria/angular-aria.js',
'bower_components/angular-cookies/angular-cookies.js',
'bower_components/angular-messages/angular-messages.js',
'bower_components/angular-resource/angular-resource.js',
'bower_components/angular-route/angular-route.js',
'bower_components/angular-sanitize/angular-sanitize.js',
'bower_components/angular-touch/angular-touch.js',
'bower_components/angular-ui-router/release/angular-ui-router.js',
'bower_components/angular-strap/dist/angular-strap.js',
'bower_components/angular-strap/dist/angular-strap.tpl.js',
'bower_components/angular-deferred-bootstrap/angular-deferred-bootstrap.js',
'bower_components/angular-ui-router.stateHelper/statehelper.js',
'bower_components/lz-string/libs/lz-string.min.js',
'bower_components/angular-ui-scroll/dist/ui-scroll.js',
'bower_components/angular-ui-scrollpoint/dist/scrollpoint.js',
'bower_components/angular-ui-event/dist/event.js',
'bower_components/angular-ui-mask/dist/mask.js',
'bower_components/angular-ui-validate/dist/validate.js',
'bower_components/angular-ui-indeterminate/dist/indeterminate.js',
'bower_components/angular-ui-uploader/dist/uploader.js',
'bower_components/angular-ui-utils/index.js',
'bower_components/angular-recaptcha/release/angular-recaptcha.js',
'bower_components/angular-local-storage/dist/angular-local-storage.js',
'bower_components/angular-bowser/src/angular-bowser.js',
'bower_components/ngAnimate-animate.css/animate.js',
'bower_components/angular-truncate/src/truncate.js',
'bower_components/blob-polyfill/Blob.js',
'bower_components/file-saver.js/FileSaver.js',
'bower_components/angular-file-saver/dist/angular-file-saver.bundle.js',
'bower_components/ng-idle/angular-idle.js',
'bower_components/jasmine/lib/jasmine-core/jasmine.js',
'bower_components/angular-mocks/angular-mocks.js',
"app/scripts/viewlevels.js",
"app/scripts/global.js",
"app/scripts/hrbui.js",
"app/scripts/hrb-mask.js",
'app/scripts/**/*.js',
'unit-tests/global.js',
'unit-tests/specs/**/*.js',
karma.confに含まれるファイルを貼り付けることができます – Don
@Don私のオリジナルの投稿にkarma.confファイルを追加しました。 –
角度のモックが同じバージョンのものであるかどうかを確認できます – Don