I use karma for my angularjs test. When I run npm test, my tests run, but then the browser shuts down. I tested it with Chrome, PhantomJS, Safari and Firefox. Here is mine karma.conf.js.
module.exports = function(config) {
config.set({
basePath: '',
frameworks: ['jasmine'],
files: [
"app/bower_components/jquery/jquery.js",
"app/bower_components/es5-shim/es5-shim.js",
"app/bower_components/angular/angular.js",
'app/bower_components/angular-mocks/angular-mocks.js',
"app/bower_components/json3/lib/json3.min.js",
"app/bower_components/sass-bootstrap/dist/js/bootstrap.js",
"app/bower_components/angular-resource/angular-resource.js",
"app/bower_components/angular-cookies/angular-cookies.js",
"app/bower_components/angular-sanitize/angular-sanitize.js",
"app/bower_components/angular-route/angular-route.js",
"app/bower_components/angular-touch/angular-touch.js",
"app/bower_components/ngstorage/ngStorage.js",
"app/bower_components/underscore/underscore.js",
"app/bower_components/fastclick/lib/fastclick.js",
'app/scripts/*.js',
'app/scripts/**/*.js',
'test/spec/**/*.js'
],
exclude: [],
port: 8080,
logLevel: config.LOG_INFO,
singleRun: false,
autoWatch: true,
browsers: ['Chrome', 'Firefox', 'Safari', 'PhantomJS'],
plugins : [
'karma-junit-reporter',
'karma-phantomjs-launcher',
'karma-chrome-launcher',
'karma-firefox-launcher',
'karma-script-launcher',
'karma-jasmine'
],
junitReporter : {
outputFile: 'test_out/unit.xml',
suite: 'unit'
}
});
};
When changing, logLevel: config.LOG_DEBUGI get the following output on my terminal:
PhantomJS 1.9.7 (Mac OS X): Executed 1 of 1 SUCCESS (0.007 secs / 0.028 secs)
DEBUG [karma]: Run complete, exitting.
DEBUG [launcher]: Disconnecting all browsers
DEBUG [launcher]: Process PhantomJS exited with code 0
I thought that would singleRun: falsenot allow closing the browser instance. What am I doing wrong?