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

angularjs, javascript, karma-runner, node.js

Solution

I had a face palm moment. `karma start` needs to be run in the same directory as your `karma.conf.js` file.

Problem

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

Original source

Related problems