Skip to content

Commit cd3d30c

Browse files
authored
fix(@angular/build): warn about unsupported options in the unit-test karma runner
The karma runner silently ignored `providersFile`, `outputFile` and `coverageReporters`. For example, `ng test --runner karma --coverage --coverage-reporters lcov` wrote no `lcov.info` and printed nothing. Log the same "not supported" warning that the runner already logs for its other unsupported options.
1 parent 79b278c commit cd3d30c

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

  • packages/angular/build/src/builders/unit-test/runners/karma

‎packages/angular/build/src/builders/unit-test/runners/karma/executor.ts‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,24 @@ export class KarmaExecutor implements TestExecutor {
5353
);
5454
}
5555

56+
if (unitTestOptions.providersFile) {
57+
context.logger.warn(
58+
'The "karma" test runner does not support the "providersFile" option. The option will be ignored.',
59+
);
60+
}
61+
62+
if (unitTestOptions.outputFile) {
63+
context.logger.warn(
64+
'The "karma" test runner does not support the "outputFile" option. The option will be ignored.',
65+
);
66+
}
67+
68+
if (unitTestOptions.coverage?.reporters) {
69+
context.logger.warn(
70+
'The "karma" test runner does not support the "coverageReporters" option. The option will be ignored.',
71+
);
72+
}
73+
5674
const buildTargetOptions = (await context.validateOptions(
5775
await context.getTargetOptions(unitTestOptions.buildTarget),
5876
await context.getBuilderNameForTarget(unitTestOptions.buildTarget),

0 commit comments

Comments
 (0)