Javascript 角度-Jasmine错误,有两个“beforeach”

Javascript 角度-Jasmine错误,有两个“beforeach”,javascript,angularjs,jasmine,karma-runner,karma-jasmine,Javascript,Angularjs,Jasmine,Karma Runner,Karma Jasmine,这是我的密码: var candidateProfile = angular.module('CandidateProfile', ["ngMessages", "validation.match", "rzModule", "ngImgCrop", "ngLoadingSpinner", "ui.bootstrap"]); candidateProfile.controller("CandidateProfileController", ['$scope', 'ProfileServi

这是我的密码:

var candidateProfile = angular.module('CandidateProfile', ["ngMessages", "validation.match", "rzModule", "ngImgCrop",   "ngLoadingSpinner", "ui.bootstrap"]);


candidateProfile.controller("CandidateProfileController", ['$scope', 'ProfileService', 'MiscService', 'authService', '$filter', 'Flash', 
function($scope, ProfileService, MiscService,authService, $filter, Flash){
//...
}

}]);
和我的规范文件:

describe('Test Profile Controller', function(){
 var $scope, ctrl;

 beforeEach(module('CandidateProfile'));

 beforeEach(inject(function($rootScope){
    //Empty just to verify, had more code before
 }));

 it("should pass", function(){
    expect(true).toBe(true);
 });
});
问题是,如果我有两个这样的“之前”,因果报应就会失败。如果我对其中一个进行注释,则测试通过。尽管如此,这两种情况都会导致它失败,出现“Errornative//某些行…”。。。位于object.workFn angular-mocks.js


有什么线索吗?我确信这可能是我的问题,我只是看不到它。

它可能与模块相关

修复方法应该是在每个模块之前声明另一个模块中的每个依赖模块,或者只是添加到现有的第一个模块中。请注意,从属对象前面必须有角度

angular.module('ngMessages', []); 
通读//你遗漏的几行,看看你是否能分辨出哪一行遗漏了。你并不总是需要它们,但通常你需要