From e19cab6efc885d3398afffa1a007ce31e959f074 Mon Sep 17 00:00:00 2001 From: Mike Cebrian Date: Thu, 29 Sep 2016 11:46:38 -0400 Subject: [PATCH] fix(karma): Add cli config poll option to karma default config With https://github.com/angular/angular-cli/pull/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 --- packages/angular-cli/plugins/karma.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/angular-cli/plugins/karma.js b/packages/angular-cli/plugins/karma.js index 1c17e28e3771..69bf559031be 100644 --- a/packages/angular-cli/plugins/karma.js +++ b/packages/angular-cli/plugins/karma.js @@ -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) => { @@ -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); @@ -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')); \ No newline at end of file +}, require('karma-webpack'), require('karma-sourcemap-loader'));