코드를 공유하는 여러 프로젝트에서 클로저 라이브러리를 사용합니다. 우리는 현재 AngularJS 프로젝트 중 하나에서 시작하고 있습니다. 우리는 Karma 러너가 올바르게 작동하도록 노력하고 있습니다.카르마 테스트 러너 및 클로저 라이브러리 "서비스가 제공되지 않음"
나는이 게시물의 조언을 따랐지만 모든 방법으로 작동하지는 않습니다. How to configure karma-runner (also known as testacular) to work with closure-library
('my.namespaced.file')를 goog.require하기 위해 노력하고 있지만 내/네임 스페이스가/file.js이 폐쇄 라이브러리에서 goog.require ('goog.dom') 또는 무언가가있는 경우, 카르마 러너 여기
Starting Karma Server (http://karma-runner.github.io)
-------------------------------------------------------------------
INFO [karma]: Karma v0.9.2 server started at http://localhost:9876/
INFO [launcher]: Starting browser Chrome
NOT SERVED FILE undefined
INFO [Chrome 27.0 (Mac)]: Connected on socket id 3tRuxHEhooSb458fJnFt
ERROR [karma]: [TypeError: Cannot call method 'indexOf' of undefined]
TypeError: Cannot call method 'indexOf' of undefined
at /usr/local/lib/node_modules/karma/lib/web-server.js:103:28
at Array.map (native)
at /usr/local/lib/node_modules/karma/lib/web-server.js:91:43
at /usr/local/lib/node_modules/karma/lib/web-server.js:37:35
at fs.js:266:14
at Object.oncomplete (fs.js:107:15)
내 karma.conf.js이
basePath = '../../../../';
// frameworks to use
frameworks = ['jasmine', 'closure'];
// list of files/patterns to load in the browser
files = [
// closure base
{pattern: 'closure-library/closure/goog/base.js', watched: false, included: true, served: true},
{pattern: 'ne-js/src/main/js/ne-js.deps.js', watched: false, included: true, served: true},
{pattern: 'angular-ne/src/main/js/angular-ne.deps.js', watched: false, included: true, served: true},
{pattern: 'ne-webServices/src/main/js/ne-webServices.deps.js', watched: false, included: true, served: true},
{pattern: 'directives/src/main/js/directives.deps.js', watched: false, included: true, served: true},
{pattern: 'webapp/src/main/js/webapp.deps.js', watched: false, included: true, served: true},
{pattern: 'webapp/src/test/lib/angular.js', watched: false, included: false, served: true},
{pattern: 'webapp/src/test/lib/angular-mocks.js', watched: false, included: false, served: true},
{pattern: 'webapp/src/main/js/**/*.js', watched: true, included: false, served: true},
{pattern: 'webapp/src/test/js/**/*.js', watched: true, included: true, served: true},
];
preprocessors = {
'webapp/src/test/js/**/*.js': ['closure', 'closure-iit'],
'webapp/src/main/js/**/*.js': ['closure'],
};
autoWatch = true;
browsers = ['Chrome'];
// plugins to load
plugins = [
'testacular-closure',
'karma-jasmine',
'karma-chrome-launcher',
'karma-phantomjs-launcher',
];
내 대답으로 질문이 해결되지 않습니까? – Boushley