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
Merged

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

merged 14 commits into from
Jun 7, 2021

Conversation

just-jeb
Copy link
Owner

@just-jeb just-jeb commented Dec 22, 2020

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

The builder uses jest-preset-angular@8 which uses ts-jest as TS files transformer.

What is the new behavior?

The builder uses jest-preset-angular@9 which uses custom transformer, which, in turn, uses Angular compiler for loading TS files.

Does this PR introduce a breaking change?

[x] Yes
[ ] No

Closes #999

Copy link

@autoapproval autoapproval bot left a comment

Choose a reason for hiding this comment

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

Approved 👍

MIGRATION.MD Outdated
@@ -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 😄

@just-jeb just-jeb merged commit 6bd90f8 into master Jun 7, 2021
@just-jeb just-jeb deleted the latest-jest-preset branch June 7, 2021 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update jest-preset-angular to v9
4 participants