Karma: Karma:Chrome not reporting any results

Created on 2 Sep 2014  Â·  3Comments  Â·  Source: karma-runner/karma

My first attempt with Karma is not working out very well. Two issues:

  • I only get the tests to run at all when I have autoWatch:true which was not the default;
  • and I only see that the tests have run in a debug window. All I see in the browser is:
Karma v0.12.23 - connected
Chrome 38.0.2125 (Linux) is idle

although there is a small flash of red background when I change a file. Conf file pasted below.

Can anyone advise? (I'm using code from http://www.ng-newsletter.com/advent2013/#!/day/19 )

// Karma configuration
// Generated on Tue Sep 02 2014 18:55:21 GMT+0200 (CEST)

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: ['mocha'],
    frameworks: ['jasmine'],


    // list of files / patterns to load in the browser
    files: [
        'src/bower_components/angular/angular.js',
        'src/bower_components/angular-mocks/angular-mocks.js',
        // 'src/javascripts/*.js',
        // 'src/tests/*.js'
        'tests/*.js'
    ],


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


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


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


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

backlog

All 3 comments

The strange thing about your setup is that you don't include any source files but only tests. Not sure if it is possible to help more just base on the info provided. Maybe create a GitHub repo with your minimal project so me or someone else can have a look?

How do you lunch Karma, actually?

Thanks, i put the code https://github.com/simonh1000/testpractise and
launch with karma start karma.conf.js

On 12 September 2014 20:37, Pawel Kozlowski [email protected]
wrote:

The strange thing about your setup is that you don't include any source
files but only tests. Not sure if it is possible to help more just base on
the info provided. Maybe create a GitHub repo with your minimal project so
me or someone else can have a look?

How do you lunch Karma, actually?

—
Reply to this email directly or view it on GitHub
https://github.com/karma-runner/karma/issues/1181#issuecomment-55443422.

For questions and support please use the mailing list or Gitter.
The issue tracker is for bug reports and feature discussions only.

Was this page helpful?
0 / 5 - 0 ratings