Karma测试没有运行

时间:2014-12-09 15:08:31

标签: tdd karma-runner karma-jasmine karma-coverage

我正在尝试执行我开发的网络应用。 Web应用程序托管在Weblogic中,并具有以下访问URL:

http://localhost:7001/webapp/

我遇到的问题是测试没有被执行,它只是弹出一个Firefox窗口,在那里我可以看到" Karma v0.12.28 - connected"。这是我的karma.conf.js文件:

// Karma configuration
// Generated on Fri Mar 21 2014 15:43:33 GMT+0000 (GMT)

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

        // base path, that will be used to resolve files and exclude
        basePath: './',

        // frameworks to use
        frameworks: ['jasmine', 'requirejs'],

        // list of files / patterns to load in the browser
        files: [
            {pattern: 'src/webapp/javascript-webapp/**/*.hb', included: false, watched: false, served: true},

            {pattern: 'src/webapp/xsltforms/xsltforms.js', included: false, watched: false, served: true},
            {pattern: 'src/webapp/xsltforms/utils/exsltforms/exsltforms.js', included: false, watched: false, served: true},
            {pattern: 'src/webapp/xsltforms/utils/ckeditor/ckeditor.js', included: false, watched: false, served: true},

            {pattern: 'src/webapp/javascript-webapp/**/*.js', included: false},
            {pattern: 'src/webapp/test/jasmine-tests/**/*.js', included: false},
            {pattern: 'src/webapp/test/jasmine-tests/fixtures/*.html', included: false},

            'karma-main.js'
        ],

        // list of files to exclude
        exclude: [
            //Broken Tests?
            'src/webapp/test/jasmine-tests/form/jasmine.forms.js',
            'src/webapp/test/jasmine-tests/stepeditor/jasmine.tabsview.js',
            'src/webapp/test/jasmine-tests/mobile/jasmine.webapp.appcachelistener.js',
            'src/webapp/test/jasmine-tests/jasmine.webapp.richtexteditorconfig.js',
            'src/webapp/test/jasmine-tests/group/casenote/views/jasmine.casenoteeditordialogview.js'
        ],

        preprocessors: {
            '**/*.html': []
        },

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

        junitReporter: {
            outputFile: 'target/test-reports/jasmine-results.xml'
        },

        // web server port
        //port: 9876,
    port: 7001,

        runnerPort: 9000,

        // 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_INFO,

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

        // Start these browsers, currently available:
        // - Chrome
        // - ChromeCanary
        // - Firefox
        // - Opera (has to be installed with `npm install karma-opera-launcher`)
        // - Safari (only Mac; has to be installed with `npm install karma-safari-launcher`)
        // - PhantomJS
        // - IE (only Windows; has to be installed with `npm install karma-ie-launcher`)
        browsers: ['Firefox'],

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

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

    });

};

任何提示?

感谢。

0 个答案:

没有答案