首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >无法加载"teamcity",它未注册!也许你遗漏了一些插件?

无法加载"teamcity",它未注册!也许你遗漏了一些插件?
EN

Stack Overflow用户
提问于 2013-10-22 17:47:41
回答 1查看 8K关注 0票数 19

我正尝试在teamcity (version 7.1).上运行我的karma (version v0.10.2)单元测试

当我运行karma start --reporters teamcity --single-run时,我得到以下错误:

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

我已经安装了karma-teamcity-reporter模块,但这并没有帮助。

我的本地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:

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
    });
};

如果我运行karma start karma.conf.js,它就能正常运行。我做错了什么?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-10-22 20:16:49

原来我需要将karma-teamcity-reporter添加到plugins部分才能使其正常工作:

...

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

...
票数 33
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19514395

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档