Skip to content

Commit 5f8230c

Browse files
alan-agius4hansl
authored andcommitted
fix(@angular-devkit/build-angular): ng test without reporters no longer print error
Closes #12455
1 parent c13cbd4 commit 5f8230c

File tree

1 file changed

+5
-1
lines changed
  • packages/angular_devkit/build_angular/src/karma

1 file changed

+5
-1
lines changed

packages/angular_devkit/build_angular/src/karma/index.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,13 @@ export class KarmaBuilder implements Builder<KarmaBuilderSchema> {
7373

7474
if (options.reporters) {
7575
// Split along commas to make it more natural, and remove empty strings.
76-
karmaOptions.reporters = options.reporters
76+
const reporters = options.reporters
7777
.reduce<string[]>((acc, curr) => acc.concat(curr.split(/,/)), [])
7878
.filter(x => !!x);
79+
80+
if (reporters.length > 0) {
81+
karmaOptions.reporters = reporters;
82+
}
7983
}
8084

8185
const sourceRoot = builderConfig.sourceRoot && resolve(root, builderConfig.sourceRoot);

0 commit comments

Comments
 (0)