angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Angular Cli: 6.0.1 code coverage thresholds not failing ng test task

Open banjankri opened this issue 8 years ago • 23 comments

After upgrade to Angular Cli 6.x the code coverage thresholds enforced by the karma-coverage-istanbul-reporter do not make the testing command fail with emitWarning set to false as they used to when using Angular Cli 6.0.1.

Versions

Angular CLI: 6.0.1
Node: 8.9.1
OS: win32 x64
Angular: 6.0.1
... animations, cli, common, compiler, compiler-cli, core, forms
... http, platform-browser, platform-browser-dynamic
... platform-server, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.6.1
@angular-devkit/build-angular     0.6.1
@angular-devkit/build-optimizer   0.6.1
@angular-devkit/core              0.6.1
@angular-devkit/schematics        0.6.1
@ngtools/webpack                  6.0.1
@schematics/angular               0.6.1
@schematics/update                0.6.1
rxjs                              6.1.0
typescript                        2.7.2
webpack                           4.6.0

Repro steps

  1. Create a repo using Angular Cli 1.7.x
  2. Enforce thresholds
  3. See the test command failing
  4. Upgrade Angular Cli and migrate

Observed behavior

The error is emitted by the reporter, however seems ignored by the angular client.

Desired behavior

The test command should be failing when thresholds not met as it used to.

Mention any other details that might be useful (optional)

Tried with both [email protected] and 2.x, reporter version 0.x and 1.x. Seems that stops working as soon as the upgrade of Angular Client is done. Same repo with Angular Client 1.7 behaves correctly.

banjankri avatar May 21 '18 10:05 banjankri

Hi I'll leave this this a couple of days open to see if anyone provide a reproduction were when using --code-coverage together with emitWarning: false the process is not exiting with a non zero error code. (Providing the karma.conf.js should be enough)

At this point, I am unable to replicate any of the issues reported. Thanks.

alan-agius4 avatar Jun 20 '19 07:06 alan-agius4

Closing, as no further details provided.

If the issue persists kindly open a new issue with a reproduction.

Thanks.

alan-agius4 avatar Jul 08 '19 05:07 alan-agius4

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.