Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use jest-preset-angular@9 #913

Merged
merged 14 commits into from
Jun 7, 2021
3 changes: 3 additions & 0 deletions MIGRATION.MD
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ In order to make this breaking change as backward compatible as possible, the de
This is as close as possible to the [`smart` merge strategy](https://github.com/survivejs/webpack-merge/tree/v4.2.2#smart-merging) that was used before, so ideally if you didn't use `mergeStrategies` then your configuration should work just as it worked before.
Otherwise you'll have to adjust the `mergeRules` in accordance with your needs.

## Jest builder
1. `jest-preset-angular` has been updated to version 9, which uses Angular compiler instead of `ts-jest` in order to transform the TS files. Make sure you understand the implications and perform all the necessary changes to your code base as described in `jest-preset-angular` [CHANGELOG](https://github.com/thymikee/jest-preset-angular/blob/master/CHANGELOG.md).
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, jest-preset-angular have reverted that change and will still use ts-jest for isolatedModules: false. With isolatedModules: true, codes will be transformed via jest-preset-angular instead of ts-jest.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ahnpnl thanks for noticing. Anyways this update will have to wait until they release stable version 9.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still waiting for Jest 27. Once Jest 27 is out, version 9 will follow too.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9.0.0 was out.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we try to update to the latest version now and also update the MIGRATION.MD? [email protected]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@just-jeb any update on this? still have to use plain jest to run angular tests

Copy link
Owner Author

@just-jeb just-jeb Jun 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've pushed changes according to the breaking changes from the CHANGELOG, if it passes I'll update the migration guide and merge.
However, if there are issues I won't be able to investigate properly since I'm away from computer until June 20th.

You're welcome to help though if there are issues with the build/tests - while I can't investigate I can release a new version from my phone 😄


# Migration from version 9 to version 10

## Jest builder
Expand Down
2 changes: 1 addition & 1 deletion packages/jest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"dependencies": {
"@angular-devkit/architect": ">=0.1100.0 < 0.1200.0",
"@angular-devkit/core": "^11.0.0",
"jest-preset-angular": "^8.3.2",
"jest-preset-angular": "^9.0.0-next.4",
"lodash": "^4.17.15"
},
"peerDependencies": {
Expand Down