Skip to content

Commit

Permalink
test: faster unit tests (#36)
Browse files Browse the repository at this point in the history
set development mode by default for faster runs
accept command line arguments to override
  • Loading branch information
OrenMe committed Sep 2, 2020
1 parent 30a04a2 commit e673b90
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
let webpackConfig = require('./webpack.config.js');
//Need to remove externals otherwise they won't be included in test
delete webpackConfig.externals;
// Need to define inline source maps when using karma
webpackConfig.devtool = 'inline-source-map';

const isWindows = /^win/.test(process.platform);
const isMacOS = /^darwin/.test(process.platform);
// Create custom launcher in case running with Travis
Expand All @@ -28,7 +22,12 @@ module.exports = function (config) {
'test/setup/karma.js': ['webpack', 'sourcemap']
},
reporters: ['progress', 'coverage'],
webpack: webpackConfig,
webpack: {
...require('./webpack.config.js'),
externals: {}, //Need to remove externals otherwise they won't be included in test
devtool: 'inline-source-map', // Need to define inline source maps when using karma
mode: config.mode || 'development' // run in development mode by default to avoid minifying -> faster
},
webpackServer: {
noInfo: true
},
Expand Down

0 comments on commit e673b90

Please sign in to comment.