Skip to content

Commit

Permalink
fix: disable webpack rebuilds on karma --single-run
Browse files Browse the repository at this point in the history
  • Loading branch information
mattlewis92 committed Dec 15, 2017
1 parent b361ff4 commit 41d1912
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/karma-webpack.js
Expand Up @@ -16,6 +16,7 @@ function Plugin(
/* config.basePath */ basePath,
/* config.files */ files,
/* config.frameworks */ frameworks,
/* config.singleRun */ singleRun,
customFileHandlers,
emitter
) {
Expand All @@ -27,7 +28,7 @@ function Plugin(

applyOptions.forEach(function(webpackOptions, index) {
// The webpack tier owns the watch behavior so we want to force it in the config
webpackOptions.watch = true
webpackOptions.watch = !singleRun

// Webpack 2.1.0-beta.7+ will throw in error if both entry and plugins are not specified in options
// https://github.com/webpack/webpack/commit/b3bc5427969e15fd3663d9a1c57dbd1eb2c94805
Expand Down
2 changes: 1 addition & 1 deletion test/unit/plugin.test.js
Expand Up @@ -12,7 +12,7 @@ describe('Plugin', function() {
cb(new Error('test error'))
}
}
var Plugin = new webpackPlugin[1]({}, {}, {}, '', [], [], [], emitterMock)
var Plugin = new webpackPlugin[1]({}, {}, {}, '', [], [], true, [], emitterMock)

Plugin.addFile('test.js')
Plugin.make(compilationMock, function(err) {
Expand Down

0 comments on commit 41d1912

Please sign in to comment.