业力无法匹配任何js文件

Karma can't match any js file

我启动了

karma start karma.conf.js  --log-level debug --single-run

并获得

16 12 2015 14:53:16.764:WARN [plugin]: Error during loading "C:\Users\denis.ev\AppData\Roaming\npm\node_modules/karma-phantomjs-launcher" plugin: Cannot find module 'phantomjs'

16 12 2015 14:53:17.245:WARN [reporter]: Can not load "junit", it is not registered! Perhaps you are missing some plugin?

16 12 2015 14:53:17.510:WARN [watcher]: Pattern "C:/Users/denis.ev/Documents/Bleu[hottask]/Bleu.Web/src/assets/libs/jquery-2.1.4.js" does not match any file.

16 12 2015 14:53:17.578:WARN [watcher]: Pattern "C:/Users/denis.ev/Documents/Bleu[hottask]/Bleu.Web/src/assets/libs/moment.js" does not match any file.

16 12 2015 14:53:17.603:WARN [watcher]: Pattern "C:/Users/denis.ev/Documents/Bleu[hottask]/Bleu.Web/src/assets/libs/bootstrap.js" does not match any file.

16 12 2015 14:53:17.711:WARN [watcher]: Pattern "C:/Users/denis.ev/Documents/Bleu[hottask]/Bleu.Web/src/assets/libs/angular.js" does not match any file.

16 12 2015 14:53:19.426:WARN [watcher]: Pattern "C:/Users/denis.ev/Documents/Bleu[hottask]/Bleu.Web/src/assets/libs/angular/angularjs-nvd3-directives.js" does not match any file.

16 12 2015 14:53:19.690:INFO [karma]: Karma v0.13.15 server started at http://localhost:9876/

16 12 2015 14:53:19.920:WARN [launcher]: Can not load "PhantomJS", it is not registered!

karma.conf.js

// Karma configuration
// Generated on Tue Jul 22 2014 13:41:07 GMT+0400 (Russian Standard Time)

module.exports = function (config) {
    config.set({

        // base path that will be used to resolve all patterns (eg. files, exclude)
        basePath: '../',


        // frameworks to use
        // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
        frameworks: ['jasmine'],


        // list of files / patterns to load in the browser
        /*
         * "~/src/assets/libs/jquery-{version}.js",
                "~/src/assets/libs/moment.js",
                "~/src/assets/libs/bootstrap.js",
                "~/src/assets/libs/angular.js",
                "~/src/assets/libs/angular/angular-ui-router.js",
                "~/src/assets/libs/angular/ui-bootstrap-tpls.js",
                "~/src/assets/libs/angular/ui-grid.js",
                "~/src/assets/libs/angular/angular-moment.js",
                "~/src/assets/libs/angular/datetime-picker.js",
                "~/src/assets/libs/angular/angular-local-storage.js",
                "~/src/assets/libs/angular/ng-tags-input.modified.js",
                "~/src/assets/libs/angular/ng-file-upload.js"
         */
        files: [
            { pattern: 'Bleu.Web/src/assets/libs/jquery-2.1.4.js', included: true },
            { pattern: 'Bleu.Web/src/assets/libs/moment.js', included: true },
            { pattern: 'Bleu.Web/src/assets/libs/bootstrap.js', included: true },
            { pattern: 'Bleu.Web/src/assets/libs/angular.js', included: true },
            { pattern: 'Bleu.Web/src/assets/libs/angular/angular-ui-router.js', included: true },
            { pattern: 'Bleu.Web/src/assets/libs/angular/ui-bootstrap-tpls.js', included: true },
            { pattern: 'Bleu.Web/src/assets/libs/angular/ui-grid.js', included: true },
            { pattern: 'Bleu.Web/src/assets/libs/angular/angular-moment.js', included: true },
            { pattern: 'Bleu.Web/src/assets/libs/angular/datetime-picker.js', included: true },
            { pattern: 'Bleu.Web/src/assets/libs/angular/angular-local-storage.js', included: true },
            { pattern: 'Bleu.Web/src/assets/libs/angular/ng-tags-input.modified.js', included: true },
            { pattern: 'Bleu.Web/src/assets/libs/angular/ng-file-upload.js', included: true },
            { pattern: 'Bleu.Web/src/assets/libs/angular/ng-sortable.js', included: true },
            { pattern: 'Bleu.Web/src/assets/libs/angular/angular-ui-tree.js', included: true },
            { pattern: 'Bleu.Web/src/app/*/*.js', included: true },
            { pattern: 'Bleu.Web/src/core/*/*.js', included: true },
            { pattern: 'Bleu.Web/src/**/services/*.js', included: true },
            { pattern: 'Bleu.Web/src/**/models/*.js', included: true },
            { pattern: 'Bleu.Web/src/**/mappers/*.js', included: true },
            { pattern: 'Bleu.Web/src/**/constants/*.js', included: true },
            { pattern: 'Bleu.Web/src/**/enums/*.js', included: true },
            { pattern: 'Bleu.Web/src/**/helpers/*.js', included: true },
            { pattern: 'Bleu.Web/src/core/main/transports/FakeTransport.js', included: true },
            { pattern: 'Bleu.Web.Tests.Client/mocks/*/*.js', included: true },
            { pattern: 'Bleu.Web.Tests.Client/mocks/**/*.js', included: true },
            { pattern: 'Bleu.Web.Tests.Client/testData/**/*.js', included: true },
            { pattern: 'Bleu.Web.Tests.Client/Specs/**/*.js', included: true },
            { pattern: 'Bleu.Web/src/assets/libs/d3.js', included: true },
            { pattern: 'Bleu.Web/src/assets/libs/nv.d3.js', included: true },
            { pattern: 'Bleu.Web/src/assets/libs/angular/angularjs-nvd3-directives.js', included: true }
        ],

        // list of files to exclude
        exclude: [
        ],


        // preprocess matching files before serving them to the browser
        // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
        preprocessors: {
        },


        // test results reporter to use
        // possible values: 'dots', 'progress'
        // available reporters: https://npmjs.org/browse/keyword/karma-reporter
        //reporters: ['progress'],
        //reporters: ['html'],
        reporters: ['dots', 'junit'],
        junitReporter: {
            outputFile: 'test-results.xml'
        },


        // web server port
        port: 9876,


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


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

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


        // start these browsers
        // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
        //browsers: ['Chrome', 'PhantomJS', 'Firefox'],
        browsers: ['PhantomJS'],

        // Continuous Integration mode
        // if true, Karma captures browsers, runs the tests and exits
        singleRun: true
    });
};

启动测试需要什么? 谢谢

WARN [reporter]: Can not load "junit", it is not registered! Perhaps you are missing some plugin?

您没有juint-reporter 插件。通过 npm install karma-junit-reporter --save-dev

安装

WARN [plugin]: Error during loading "C:\Users\denis.ev\AppData\Roaming\npm\node_modules/karma-phantomjs-launcher" plugin: Cannot find module 'phantomjs'

您没有 phantomjs。通过 npm install -g phantomjs

安装

WARN [watcher]: Pattern "C:/Users/denis.ev/Documents/Bleu[hottask]/Bleu.Web/src/assets/libs/jquery-2.1.4.js" does not match any file.

可能 basePathpattern of files 配置错误。尝试将 basePath 设置为 ..