Karma not running unit tests due to "No captured browser" message

levelnis picture levelnis · Feb 2, 2014 · Viewed 41.3k times · Source

I'm trying to set up Karma to run AngularJS unit tests using Jasmine, but I can't get the tests to run. I'm sure I'm overlooking something simple. I'm running this on a Windows 7 machine with Node.js installed and karma installed via npm.

My directory structure looks like this:

  • js/app/ - contains controllers, app, etc
  • js/config/ - contains karma.conf.js
  • js/lib/ - contains angular
  • js/test/ - contains jasmine specs

I'm starting a command prompt in the js directory and running this command:

karma start config/karma.conf.js

That causes Chrome to run on port 9876, but whenever I change any watched files and check the Karma output, I see this info message:

No captured browser, open http://localhost:9876/

Here's my config file:

module.exports = function(config) {
  config.set({
    basePath: '../',
    frameworks: ['jasmine'],
    files: [
      'lib/angular.js',
      'app/**/*.js',
      'test/**/*.js'
    ],
    exclude: [
    ],
    reporters: ['progress'],
    port: 9876,
    colors: true,
    logLevel: config.LOG_INFO,
    autoWatch: true,
    browsers: ['Chrome'],
    captureTimeout: 60000,
    singleRun: false
  });
};

I'm using Angular 1.2.10 and Karma 0.10.9

Answer

user1460043 picture user1460043 · Mar 11, 2014

I just had the same issue in a different setup (Linux, QUnit, Firefox), though. The problem disappeared after I killed all karma processes and did a fresh karma start.