Angular-builders: Upgrade jest-preset-angular version to the latest

Created on 20 Dec 2018  路  7Comments  路  Source: just-jeb/angular-builders

Describe the bug

When running test coverage any import into a constructor (and some other things) show a false "uncovered branch" where there is no branch.

This is a long standing issue with istanbul that I believe was finally resolved.

According to this issue https://github.com/kulshekhar/ts-jest/issues/818 on ts-jest this can be resolved by simply upgrading jest-preset-angular to 7.0.0-alpha.1 instead of the current ^6.0.0

To Reproduce
Steps to reproduce the behavior:

  1. Run tests
  2. See inaccurate branch coverage

Expected behavior

branch coverage should be accurate

Screenshots

screen shot 2018-12-19 at 9 35 45 pm

(I can't get the tooltip in the screenshot, but it says "branch not covered")

Builder:

  • The name of the builder: @angular-builders/jest
  • The version of the builder: ^7.1.2

Libraries

  • angular-devkit/build-angular:^0.10.7
jest

Most helpful comment

I'm not sure it would be smart to add a dependency on alpha version.
Let's wait at least until RC is released and then I'll update.
If it's a deal breaker, I can create an alpha version of jest builder that depends on alpha version of jest-preset-angular.

All 7 comments

I'm not sure it would be smart to add a dependency on alpha version.
Let's wait at least until RC is released and then I'll update.
If it's a deal breaker, I can create an alpha version of jest builder that depends on alpha version of jest-preset-angular.

Would be great idea to make also a Alpha version, as it influences the coverage report quite a lot!

Use version 7.3.0-alpha.1. It can be installed with npm i -D @angular-builders/jest@jest-preset-alpha

Have tried version jest-preset-alpha, it works perfectly 馃憤

Is there anything I need to change in the config, because first it took around 45-50sec to run, and now I killed it after 10 minutes.

Package.json:
Angular 7.2.0
"@angular-builders/jest": "7.3.0-alpha.1",
"ts-jest": "23.10.5",
"jest": "23.6.0",
"jest-junit": "6.0.1",

Angular.json:

"test": {
   "builder": "@angular-builders/jest:run",
   "options": {
     "no-cache": true
  }
}

Not that I'm aware of... Can you create minimal reproduction?

There is one pref fixing PR upcoming: kulshekhar/ts-jest#940

Was this page helpful?
0 / 5 - 0 ratings

Related issues

renatoaraujoc picture renatoaraujoc  路  6Comments

muuvmuuv picture muuvmuuv  路  10Comments

Mds92 picture Mds92  路  5Comments

bisonfoutu picture bisonfoutu  路  10Comments

jankeesvanandel picture jankeesvanandel  路  5Comments