diff --git a/packages/angular_devkit/build_angular/src/karma/index.ts b/packages/angular_devkit/build_angular/src/karma/index.ts index 3d1b066d9f1b..8e41e89a7dc5 100644 --- a/packages/angular_devkit/build_angular/src/karma/index.ts +++ b/packages/angular_devkit/build_angular/src/karma/index.ts @@ -73,9 +73,13 @@ export class KarmaBuilder implements Builder { if (options.reporters) { // Split along commas to make it more natural, and remove empty strings. - karmaOptions.reporters = options.reporters + const reporters = options.reporters .reduce((acc, curr) => acc.concat(curr.split(/,/)), []) .filter(x => !!x); + + if (reporters.length > 0) { + karmaOptions.reporters = reporters; + } } const sourceRoot = builderConfig.sourceRoot && resolve(root, builderConfig.sourceRoot);