그래서 내가 webstorm에서 각도 JS 프로젝트를 설정하고 모든 카르마 테스트 스위트
을 제외하고 제대로 작동beforeEach(module('[modulename]'));
을 내 테스트는 다음과 같습니다 :
나는 다음과 같은 모델을 설정하고
it('should work', ((function() {
//spec body
expect(true).toBe(true);
})));
작품과 통과,하지만
it('should work, does it?', (inject(function(_$http_) {
//spec body
$http=_$http_;
expect(true).toBe(true);
})));
는 테스트에 실패뿐만 아니라 갑자기 내 모듈은 더 이상로드 : S
Error: [$injector:modulerr] Failed to instantiate [modulename] due to: Error: [$injector:nomod] Module '[modulename]' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
이유도 두 테스트에서 퍼팅 (분사없이) 첫 번째 테스트에 완벽하게 잘 작동하는 것 같다하지만 - 두 번째 I가 브라우저 창에 내 응용 프로그램을 실행하면 모든 작동하므로 오류가 테스트 파일 또는 무언가에 있어야한다 : 하나는 여전히
중요이 ... 앞에서 언급 한 것처럼 실패 S
차라리 새로운 해요 각을 이루는 js와 karma s에 나는 이것이 바보 같은 질문이 아니길 바란다.