2014-09-22 6 views
1

내가 재스민과 뻔뻔 스러움을 사용하여 내 AngularJS와 솔루션에 대한 단위 테스트를 쓰고 있어요 그리고 나는 그것이 캔트 변수 모듈을 찾을 말하는 ReferenceError가가 계속 ... 자바 스크립트 참조 오류가

이 내가 계속 오류 메시지입니다 점점 :

Test Name: appControllersTest encountered a declaration exception Test FullName: ..\scripts_references.js::appcontrollerstest::encountered a declaration exception Test Source: ..\scripts_references.js : line 0 Test Outcome: Failed Test Duration: 0:00:00.001 Result Message: ReferenceError: Can't find variable: module in file:../scripts/unittest/controllerstest.js:20

Test Name: appControllersTest encountered a declaration exception Test FullName: ..\scripts\unittest\controllerstest.js::appcontrollerstest::encountered a declaration exception Test Source: ..\scripts\unittest\controllerstest.js : line 16 Test Outcome: Failed Test Duration: 0:00:00.001 Result Message: ReferenceError: Can't find variable: module in file:../scripts/unittest/controllerstest.js:20

이 내 단위 테스트입니다 :

/// <reference path="../_references.js" /> 
/// <reference path="../AngularJSApp/controllers.js" /> 

describe("appControllersTest", function() { 
    var $scope; 

    beforeEach(module("appMain")); 

    describe("RRCtrl", function() { 

     beforeEach(inject(function ($controller) { 
      $scope = {}; 
      $controller("RRCtrl", { $scope: $scope }); 
     })); 

     it("JavaTestTest", function ($controller) { 
      expect(scope.$root.title).toBe(""); 
     }); 
    }); 
}); 

사람이 이런 종류의 오류가 발생하여 당신이 그것을 어떻게 해결할 수 있습니까?

+0

모듈 기능은 어디에 정의되어 있습니까? –

+0

/AngularJSApp/app.js에 넣으십시오. – Warsaw

+0

전체 AngularJSApp 폴더에 대한 참조 경로를 추가하려고했지만 여전히 동일한 오류 메시지가 표시됩니다. – Warsaw

답변

0

무엇이 잘못되었는지 알아 냈습니다. 일부 참조는 _reference.js에서 잘못된 순서로 선언되었습니다. 수동으로 변경 한 후 작동했습니다.