VSC enable debugger for testing (#2505)

This commit is contained in:
Nikhil 2019-10-10 12:25:24 -07:00 committed by Andrew Henry
parent 9b7a986475
commit ff5b88b544
2 changed files with 13 additions and 10 deletions

View File

@ -23,9 +23,9 @@
/*global module,process*/
const devMode = process.env.NODE_ENV !== 'production';
const browsers = [process.env.NODE_ENV === 'debug' ? 'ChromeDebugging' : 'ChromeHeadless'];
module.exports = (config) => {
const webpackConfig = require('./webpack.config.js');
delete webpackConfig.output;
@ -50,11 +50,17 @@ module.exports = (config) => {
'coverage',
'html'
],
browsers: ['ChromeHeadless'],
browsers: browsers,
customLaunchers: {
ChromeDebugging: {
base: 'Chrome',
flags: ['--remote-debugging-port=9222'],
debug: true
}
},
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
coverageReporter: {
dir: process.env.CIRCLE_ARTIFACTS ?
process.env.CIRCLE_ARTIFACTS + '/coverage' :
@ -66,22 +72,18 @@ module.exports = (config) => {
}
}
},
// HTML test reporting.
htmlReporter: {
outputDir: "dist/reports/tests",
preserveDescribeNesting: true,
foldAll: false
},
preprocessors: {
// add webpack as preprocessor
'platform/**/*Spec.js': [ 'webpack' ],
'src/**/*Spec.js': [ 'webpack' ]
'platform/**/*Spec.js': [ 'webpack', 'sourcemap' ],
'src/**/*Spec.js': [ 'webpack', 'sourcemap' ]
},
webpack: webpackConfig,
webpackMiddleware: {
stats: 'errors-only',
logLevel: 'warn'
@ -89,4 +91,3 @@ module.exports = (config) => {
singleRun: true
});
}

View File

@ -43,6 +43,7 @@
"karma-coverage": "^1.1.2",
"karma-html-reporter": "^0.2.7",
"karma-jasmine": "^1.1.2",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^3.0.0",
"location-bar": "^3.0.1",
"lodash": "^3.10.1",
@ -79,6 +80,7 @@
"build:dev": "webpack",
"build:watch": "webpack --watch",
"test": "karma start --single-run",
"test-debug": "NODE_ENV=debug karma start --no-single-run",
"test:watch": "karma start --no-single-run",
"verify": "concurrently 'npm:test' 'npm:lint'",
"jsdoc": "jsdoc -c jsdoc.json -R API.md -r -d dist/docs/api",