2013-10-22 4 views
16

나는 내가 다음과 같은 오류 얻을 karma start --reporters teamcity --single-run 실행하면 teamcity (version 7.1)."팀 시티"를로드 할 수 없습니다. 등록되지 않았습니다! 아마도 일부 플러그인이 누락 되었습니까?

karma (version v0.10.2) 단위 테스트를 실행하려고 해요 : 나는 카르마-인 TeamCity-기자 모듈을 설치 한

Can not load "teamcity", it is not registered! Perhaps you are missing some plugin? 

을하지만, '그 hasn 도와 줬어.

다음

내 로컬 node_modules 폴더에 설치됩니다

karma 
karma-chrome-launcher 
karma-coffee-preprocessor 
karma-coverage 
karma-firefox-launcher 
karma-html2js-preprocessor 
karma-jasmine 
karma-phantomjs-launcher 
karma-requirejs 
karma-script-launcher 
karma-teamcity-reporter 
여기

내 karma.conf.js : 나는 karma start karma.conf.js을 실행하면

I'm running karma version v0.10.2. Here's my karma.conf.js: 

module.exports = function(karma) { 
    karma.set({ 
     // base path, that will be used to resolve files and exclude 
     basePath: '../../myapplication.web', 

     frameworks: ['jasmine'], 

     plugins: [ 
      'karma-jasmine', 
      'karma-coverage', 
      'karma-chrome-launcher', 
      'karma-phantomjs-launcher' 
     ], 

     // list of files/patterns to load in the browser 
     files: [ 
      'Scripts/jquery/jquery-2.0.2.min.js', 
      'Scripts/jquery-ui/jquery-ui-1.10.3.min.js', 
      'Scripts/daterangepicker/daterangepicker.js', 
      'Scripts/angular/angular.js', 
      'Scripts/angular/restangular/underscore-min.js', 
      'Scripts/angular/restangular/restangular-min.js', 
      'Scripts/angular/angular-*.js', 
      'Scripts/angular/angular-test/angular-*.js', 
      'Scripts/angular/angular-ui/*.js', 
      'Scripts/angular/angular-strap/*.js', 
      'Scripts/angular/angular-http-auth/*.js', 
      'Scripts/sinon/*.js', 
      'Scripts/moment/moment.min.js', 
      'uifw/scripts/ui-framework-angular.js', 
      'app/app.js', 
      'app/**/*.js', 
      'Tests/unit/**/*.js' 
     ], 


     // list of files to exclude 
     exclude: [ 
      'Scripts/angular/angular-test/angular-scenario.js' 
     ], 

     // test results reporter to use 
     // possible values: 'dots', 'progress', 'junit' 
     reporters: ['progress', 'coverage', 'teamcity'], 

     preprocessors : { 
      'app/**/*.js': ['coverage'] 
     }, 

     coverageReporter : { 
      type: 'html', 
      dir: 'Tests/coverage/' 
     }, 

     // web server port 
     port : 9876, 

     // cli runner port 
     runnerPort : 9100, 

     // enable/disable colors in the output (reporters and logs) 
     colors : true, 


     // level of logging 
     // possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG 
     logLevel : karma.LOG_INFO, 


     // enable/disable watching file and executing tests whenever any file changes 
     autoWatch : true, 

     // Start these browsers, currently available: 
     // - Chrome 
     // - ChromeCanary 
     // - Firefox 
     // - Opera 
     // - Safari (only Mac) 
     // - PhantomJS 
     // - IE (only Windows) 
     browsers: ['PhantomJS'], 

     // If browser does not capture in given timeout [ms], kill it 
     captureTimeout : 60000, 


     // Continuous Integration mode 
     // if true, it capture browsers, run tests and exit 
     singleRun : true 
    }); 
}; 

이 제대로 실행합니다. 내가 도대체 ​​뭘 잘못하고있는 겁니까? 정보가있다

답변

29

나는이 작업을 얻기 위해 plugins 섹션 karma-teamcity-reporter를 추가하는 데 필요한 :

... 

plugins: [ 
      'karma-teamcity-reporter', 
      'karma-jasmine', 
      'karma-coverage', 
      'karma-chrome-launcher', 
      'karma-phantomjs-launcher' 
     ], 

... 
+4

당신은 또한'''NPM 카르마-인 TeamCity-reporter''' –

+0

브릴리언트를 설치해야 할 수 있습니다. 그것이 왜 나를 위해 일하지 않고 있는지 궁금해하고 있었다. 감사. – Fernando