Jasmine Karma读取了我的测试,但没有返回结果

Jasmine Karma读取了我的测试,但没有返回结果,jasmine,karma-jasmine,Jasmine,Karma Jasmine,这很奇怪。我正在尝试一些非常简单的例子。因果报应将阅读我的测试。但拒绝透露他们在输出中是通过了还是失败了 这是我的配置文件: // Karma configuration // Generated on Mon Dec 19 2016 15:50:01 GMT-0500 (Eastern Standard Time) module.exports = function(config) { config.set({ // base path that will be used to

这很奇怪。我正在尝试一些非常简单的例子。因果报应将阅读我的测试。但拒绝透露他们在输出中是通过了还是失败了

这是我的配置文件:

// Karma configuration
// Generated on Mon Dec 19 2016 15:50:01 GMT-0500 (Eastern Standard Time)

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

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


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

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

    // list of files / patterns to load in the browser
    files: [
    //'server/src/main/resources/webapp/static/app/**/*.js'
    //'server/src/main/resources/webapp/static/app/test-view/test-view-controller.spec.js',
        'test.spec.js'
    ],


    // list of files to exclude
    exclude: [
        //'bower_components',
        //'node_modules',
        //'server/src/main/resources/webapp/static/bower/**/*'
    ],


    // preprocess matching files before serving them to the browser
    // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
    preprocessors: {
      //'/**/!(*spec).js': ['coverage'],

    },


    // test results reporter to use
    // possible values: 'dots', 'progress'
    // available reporters: https://npmjs.org/browse/keyword/karma-reporter
    reporters: [],
    //reporters: [ 'coverage'],


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


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


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


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

    // Concurrency level
    // how many browser should be started simultaneous
    concurrency: Infinity
  })
}
这是我的测试文件:

'use strict'

describe('test', function() {
    it('has to equal 4',
        function() {
        expect(3).toEqual(4);
    });
});
我缺少一些基本的东西吗?昨天下午,我花了一整个下午的时间,为了让一个测试运行,我越来越多地脱衣,我不知道还有什么要做

这是调试输出,所以我知道我正在加载测试文件,但没有结果

21 12 2016 09:44:19.051:DEBUG [web-server]: serving (cached): c:/src/TT/node_mod
ules/karma-jasmine/lib/adapter.js
21 12 2016 09:44:19.054:DEBUG [middleware:source-files]: Requesting /base/test.s
pec.js?25b2b285aaae5dc1b28e003730ae0711891ed68b /
21 12 2016 09:44:19.055:DEBUG [middleware:source-files]: Fetching c:/src/tt/test
.spec.js
21 12 2016 09:44:19.056:DEBUG [web-server]: serving (cached): c:/src/tt/test.spe
c.js
21 12 2016 09:44:19.075:DEBUG [karma]: Run complete, exiting.
21 12 2016 09:44:19.078:DEBUG [launcher]: Disconnecting all browsers
21 12 2016 09:44:19.090:DEBUG [launcher]: Process PhantomJS exited with code 0
21 12 2016 09:44:19.091:DEBUG [temp-dir]: Cleaning temp dir c:\AppData\Local\Tem
p\karma-63269551
21 12 2016 09:44:19.097:DEBUG [launcher]: Finished all browsers

谁想让我觉得自己很笨,并指出破坏我一天的逗号或引号?

好吧,所以我终于在这里找到了自己的答案(值得称赞):


如果您希望将测试结果打印到控制台输出,则较新的jasmine/karma要求您通过karma spec reporter。考虑到我对karma使用的都是phantomJS,很难判断我的测试是否运行良好。令人恼火,但希望这能帮助其他陷入困境的人。

您可能正遭受此错误的折磨:谢谢。。。我试着加上这些,但没有乐趣。我还添加了一个console.log('test********');根据我的规范,这也不会出现在输出中。隐马尔可夫模型。。。还有其他想法吗?