Skip to content

Commit 63023ae

Browse files
JSMikefilipesilva
authored andcommitted
fix(karma): Add cli config poll option to karma default config (#2486)
With #1814 the `defaults.poll` property was added to angular-cli.json. This configuration setting currently applies to `ng serve` but not `ng test`. This fix adds the poll value to the karma defaults so that if you set `defaults: { poll: 1000 }` it will apply to both `ng serve` and `ng test`.
1 parent fbc585b commit 63023ae

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/angular-cli/plugins/karma.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const path = require('path');
22
const getWebpackTestConfig = require('../models/webpack-build-test').getWebpackTestConfig;
3+
const CliConfig = require('../models/config').CliConfig;
34

45
const init = (config) => {
56

@@ -23,8 +24,12 @@ const init = (config) => {
2324
timings: false,
2425
chunks: false,
2526
chunkModules: false
27+
},
28+
watchOptions: {
29+
poll: CliConfig.fromProject().config.defaults.poll
2630
}
2731
};
32+
2833
config.webpack = Object.assign(webpackConfig, config.webpack);
2934
config.webpackMiddleware = Object.assign(webpackMiddlewareConfig, config.webpackMiddleware);
3035

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

0 commit comments

Comments
 (0)