Compare commits

...

1 Commits

Author SHA1 Message Date
cd98313ab7 Added Karma debug configuration 2017-10-24 11:49:18 -07:00

View File

@ -22,6 +22,21 @@
/*global module,process*/ /*global module,process*/
module.exports = function(config) { module.exports = function(config) {
var preprocessorsConfig = ['coverage'];
var browsersConfig = ['Chrome'];
var singleRunConfig = true;
function isDebug(argument) {
return argument === '--debug';
}
if (process.argv.some(isDebug)) {
preprocessorsConfig = [];
browsersConfig = ['chrome-debug'];
singleRunConfig = false;
}
config.set({ config.set({
// Base path that will be used to resolve all file patterns. // Base path that will be used to resolve all file patterns.
@ -55,8 +70,8 @@ module.exports = function(config) {
// Preprocess matching files before serving them to the browser. // Preprocess matching files before serving them to the browser.
// https://npmjs.org/browse/keyword/karma-preprocessor // https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: { preprocessors: {
'src/**/!(*Spec).js': [ 'coverage' ], 'src/**/!(*Spec).js': preprocessorsConfig,
'platform/**/src/**/!(*Spec).js': [ 'coverage' ] 'platform/**/src/**/!(*Spec).js': preprocessorsConfig
}, },
// Test results reporter to use // Test results reporter to use
@ -77,9 +92,14 @@ module.exports = function(config) {
// Specify browsers to run tests in. // Specify browsers to run tests in.
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: [ browsers: browsersConfig,
'Chrome'
], customLaunchers: {
"chrome-debug": {
base: 'Chrome',
flags: [ '--remote-debugging-port=9333' ]
}
},
// Code coverage reporting. // Code coverage reporting.
coverageReporter: { coverageReporter: {
@ -106,6 +126,6 @@ module.exports = function(config) {
// Continuous Integration mode. // Continuous Integration mode.
// If true, Karma captures browsers, runs the tests and exits. // If true, Karma captures browsers, runs the tests and exits.
singleRun: true singleRun: singleRunConfig
}); });
}; };