8000 fix(karma): Add cli config poll option to karma default config · angular/angular-cli@e19cab6 · GitHub
[go: up one dir, main page]

Skip to content

Commit e19cab6

Browse files
JSMikeMichael Cebrian
authored andcommitted
fix(karma): Add cli config poll option to karma default config
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
1 parent 9a2c44b commit e19cab6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/angular-cli/plugins/karma.js

Lines changed: 6 additions & 1 deletion
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)
0