Skip to content

Commit

Permalink
test: faster unit tests (#81)
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 authored Sep 2, 2020
1 parent cd73937 commit d9fdba5
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 Down Expand Up @@ -38,7 +32,12 @@ module.exports = function (config) {
'test/setup/karma.js': ['webpack', 'sourcemap']
},
reporters: ['mocha', '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 d9fdba5

Please sign in to comment.