Skip to content

Commit

Permalink
fix(karma): Add cli config poll option to karma default config
Browse files Browse the repository at this point in the history
With #1814 the `defaults.poll` property was added to angular-cli.json. This configuration setting is currently set to apply to `ng serve` but not `ng test`. This fix adds the setting to the defaults that are applied to karma's config object, so that if you set `defaults: { poll: 1000 }` it will apply to both `ng serve` and `ng test`.

Fixup
  • Loading branch information
JSMike authored and Michael Cebrian committed Oct 5, 2016
1 parent 9a2c44b commit e19cab6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/angular-cli/plugins/karma.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const path = require('path');
const getWebpackTestConfig = require('../models/webpack-build-test').getWebpackTestConfig;
const CliConfig = require('../models/config').CliConfig;

const init = (config) => {

Expand All @@ -23,8 +24,12 @@ const init = (config) => {
timings: false,
chunks: false,
chunkModules: false
},
watchOptions: {
poll: CliConfig.fromProject().config.defaults.poll
}
};

config.webpack = Object.assign(webpackConfig, config.webpack);
config.webpackMiddleware = Object.assign(webpackMiddlewareConfig, config.webpackMiddleware);

Expand All @@ -45,4 +50,4 @@ preprocessor.$inject = []
module.exports = Object.assign({
'framework:angular-cli': ['factory', init],
'preprocessor:angular-cli': ['factory', preprocessor]
}, require('karma-webpack'), require('karma-sourcemap-loader'));
}, require('karma-webpack'), require('karma-sourcemap-loader'));

0 comments on commit e19cab6

Please sign in to comment.