Angularjs Karma突然不再执行测试

时间:2017-04-17 20:34:02

标签: angularjs karma-runner karma-jasmine

我正在寻找一个传统的Angularjs项目,该项目的一部分是Karma和Jasmin。到目前为止,一切运作良好,但没有任何(明显的)原因,业力本身仍然启动,但不再执行任何测试。而不是它在10000ms后超时。

我不知道如何调试它。有人可以帮忙吗?这是Karma conf

"使用严格&#34 ;;

module.exports = function (config) {
    config.set({
        basePath: './',
        files: [
            {pattern: 'app/bower_components/angular/angular.js', included: false},
            {pattern: 'app/bower_components/jquery/dist/jquery.js', included: false},
            {pattern: 'app/bower_components/angular/angular.js', included: false},
            {pattern: 'app/bower_components/bootstrap/dist/js/bootstrap.js', included: false},
            {pattern: 'app/bower_components/angular-route/angular-route.js', included: false},
            {pattern: 'app/bower_components/angular-mocks/angular-mocks.js', included: false},
            {pattern: 'app/bower_components/angularjs-datepicker/dist/angular-datepicker.min.js*', included: false},
            {pattern: 'app/app.js', included: false},
            {pattern: 'app/**/*.js', included: false},
            {pattern: 'app/**/*spec.js', included: false},

            // needs to be last http://karma-runner.github.io/0.12/plus/requirejs.html
            'app/require-config.js'
        ],
        ngHtml2JsPreprocessor: {
            stripPrefix: 'public/',
            stripSuffix: '.ext',
            // prepend this to the
            prependPrefix: 'served/',
            moduleName: 'templates'
        },
        autoWatch: true,
        frameworks: ['jasmine', 'requirejs'],
        plugins: [
            'karma-chrome-launcher',
            'karma-firefox-launcher',
            'karma-ie-launcher',
            'karma-safari-launcher',
            'karma-jasmine',
            'karma-requirejs',
            'karma-junit-reporter',
            'karma-coverage',
            'karma-ng-html2js-preprocessor',
            'karma-phantomjs-launcher'
        ],
        preprocessors: {
            'app/home/**/!(*spec)*.js': 'coverage',
            'app/navigation/**/!(*spec)*.js': 'coverage',
            'app/content/**/!(*spec)*.js': 'coverage',
            'app/alerts/**/!(*spec)*.js': 'coverage',
            'app/eco_login/**/!(*spec)*.js': 'coverage',
            'app/coms/**/!(*spec)*.js': 'coverage',
            'app/current_observations/**/!(*spec)*.js': 'coverage',
            'app/filters/**/!(*spec)*.js': 'coverage',
            'app/observation_records/**/!(*spec)*.js': 'coverage',
            'app/script_writer/**/!(*spec)*.js': 'coverage',
            'app/script_guidance/**/!(*spec)*.js': 'coverage',
            'app/databrowser/**/!(*spec)*.js': 'coverage',
            'app/eco/**/!(*spec)*.js': 'coverage',
            'app/extremes/**/!(*spec)*.js': 'coverage',
            'app/services/**/!(*spec)*.js': 'coverage',
            'app/location_data/**/!(*spec)*.js': 'coverage',
            'app/location_picker/**/!(*spec)*.js': 'coverage',
            'app/location_map/**/!(*spec)*.js': 'coverage',
            'app/text_forecast/**/!(*spec)*.js': 'coverage',
            'app/**/*.html': ["ng-html2js"]
        },
        coverageReporter: {
            reporters: [
                {
                    type: 'cobertura',
                    dir: 'coverage/',
                    subdir: function (browser) {
                        // normalization process to keep a consistent browser name across different
                        // OS
                        return browser.replace(/ /g, '_');
                    }
                },
                {
                    type: 'lcovonly',
                    dir: 'coverage/',
                    subdir: function (browser) {
                        // normalization process to keep a consistent browser name across different
                        // OS
                        return browser.replace(/ /g, '_');
                    }
                },
                {
                    type: 'html',
                    dir: 'coverage/',
                    subdir: function (browser) {
                        // normalization process to keep a consistent browser name across different
                        // OS
                        return browser.replace(/ /g, '_');
                    }
                }
            ]
        },
        browserConsoleLogOptions: {
            terminal: true,
            level: ""
        },
        // test results reporter to use
        // possible values: 'dots', 'progress'
        // available reporters: https://npmjs.org/browse/keyword/karma-reporter
        reporters: ['progress', 'coverage', 'junit'],
        junitReporter: {
            outputDir: 'coverage/',
            outputFile: 'unit.xml',
            suite: 'unit'
        },
        noColors: true,
        captureConsole: true,
        logLevelDebug: true,
        singleRun: true,
        logLevel: 'debug',
        browsers: ['Firefox']
    });
};

我将logLevelDebug设置为true,这是输出的一部分

18 04 2017 08:10:07.695:INFO [karma]: Karma v1.6.0 server started at http://0.0.0.0:9876/
    18 04 2017 08:10:07.696:INFO [launcher]: Launching browser Firefox with unlimited concurrency
18 04 2017 08:10:07.707:INFO [launcher]: Starting browser Firefox
18 04 2017 08:10:07.708:DEBUG [temp-dir]: Creating temp dir at /tmp/karma-17509431
18 04 2017 08:10:07.709:DEBUG [launcher]: firefox http://localhost:9876/?id=17509431 -profile /tmp/karma-17509431 -no-remote
    18 04 2017 08:10:09.620:DEBUG [web-server]: serving: /home/uwe/ws/ForecasterPortal/node_modules/karma/static/client.html
18 04 2017 08:10:09.950:DEBUG [web-server]: serving: /home/uwe/ws/ForecasterPortal/node_modules/karma/static/karma.js
18 04 2017 08:10:10.174:DEBUG [karma]: A browser has connected on socket NeEdoBJw1Olt5Vk5AAAA
18 04 2017 08:10:10.183:DEBUG [web-server]: serving: /home/uwe/ws/ForecasterPortal/node_modules/karma/static/favicon.ico
18 04 2017 08:10:10.276:INFO [Firefox 52.0.0 (Ubuntu 0.0.0)]: Connected on socket NeEdoBJw1Olt5Vk5AAAA with id 17509431
18 04 2017 08:10:10.277:DEBUG [launcher]: Firefox (id 17509431) captured in 2.581 secs
18 04 2017 08:10:10.278:DEBUG [web-server]: upgrade /socket.io/?EIO=3&transport=websocket&sid=NeEdoBJw1Olt5Vk5AAAA
    18 04 2017 08:10:10.320:DEBUG [middleware:karma]: custom files null null null
18 04 2017 08:10:10.322:DEBUG [middleware:karma]: Serving static request /context.html
18 04 2017 08:10:10.337:DEBUG [web-server]: serving: /home/uwe/ws/ForecasterPortal/node_modules/karma/static/context.html
18 04 2017 08:10:10.394:DEBUG [web-server]: serving: /home/uwe/ws/ForecasterPortal/node_modules/karma/static/context.js
18 04 2017 08:10:10.396:DEBUG [middleware:source-files]: Requesting /base/node_modules/requirejs/require.js?b1010092f15879164973aaba0cc26c7298118d76 /
    18 04 2017 08:10:10.396:DEBUG [middleware:source-files]: Fetching /home/uwe/ws/ForecasterPortal/node_modules/requirejs/require.js
18 04 2017 08:10:10.397:DEBUG [web-server]: serving (cached): /home/uwe/ws/ForecasterPortal/node_modules/requirejs/require.js
18 04 2017 08:10:10.399:DEBUG [middleware:source-files]: Requesting /base/node_modules/karma-requirejs/lib/adapter.js?a0765fc3eacb39184893303c3bc2e821cb041787 /
    18 04 2017 08:10:10.403:DEBUG [middleware:source-files]: Fetching /home/uwe/ws/ForecasterPortal/node_modules/karma-requirejs/lib/adapter.js
18 04 2017 08:10:10.404:DEBUG [web-server]: serving (cached): /home/uwe/ws/ForecasterPortal/node_modules/karma-requirejs/lib/adapter.js
18 04 2017 08:10:10.430:DEBUG [middleware:source-files]: Requesting /base/node_modules/jasmine-core/lib/jasmine-core/jasmine.js?916005cc407925f4764668d61d04888d59258f5d /
    18 04 2017 08:10:10.430:DEBUG [middleware:source-files]: Fetching /home/uwe/ws/ForecasterPortal/node_modules/jasmine-core/lib/jasmine-core/jasmine.js
18 04 2017 08:10:10.431:DEBUG [middleware:source-files]: Requesting /base/node_modules/karma-jasmine/lib/boot.js?945a38bf4e45ad2770eb94868231905a04a0bd3e /
    18 04 2017 08:10:10.431:DEBUG [middleware:source-files]: Fetching /home/uwe/ws/ForecasterPortal/node_modules/karma-jasmine/lib/boot.js
18 04 2017 08:10:10.431:DEBUG [middleware:source-files]: Requesting /base/node_modules/karma-jasmine/lib/adapter.js?7a813cc290d592e664331c573a1a796192cdd1ad /
    18 04 2017 08:10:10.432:DEBUG [middleware:source-files]: Fetching /home/uwe/ws/ForecasterPortal/node_modules/karma-jasmine/lib/adapter.js
18 04 2017 08:10:10.432:DEBUG [web-server]: serving (cached): /home/uwe/ws/ForecasterPortal/node_modules/jasmine-core/lib/jasmine-core/jasmine.js
18 04 2017 08:10:10.436:DEBUG [web-server]: serving (cached): /home/uwe/ws/ForecasterPortal/node_modules/karma-jasmine/lib/boot.js
18 04 2017 08:10:10.437:DEBUG [web-server]: serving (cached): /home/uwe/ws/ForecasterPortal/node_modules/karma-jasmine/lib/adapter.js
18 04 2017 08:10:20.283:WARN [Firefox 52.0.0 (Ubuntu 0.0.0)]: Disconnected (1 times), because no message in 10000 ms.
    Firefox 52.0.0 (Ubuntu 0.0.0) ERROR
Disconnected, because no message in 10000 ms.

0 个答案:

没有答案