-
Notifications
You must be signed in to change notification settings - Fork 613
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
[heft-jest-plugin] update to jest 27 #3041
[heft-jest-plugin] update to jest 27 #3041
Conversation
Signed-off-by: Janusz Dziurzynski <rzyns@users.noreply.github.com>
…st-27 Conflicts: common/config/rush/browser-approved-packages.json common/config/rush/pnpm-lock.yaml common/config/rush/repo-state.json
Signed-off-by: Janusz Dziurzynski <rzyns@users.noreply.github.com>
Signed-off-by: Janusz Dziurzynski <rzyns@users.noreply.github.com>
Jest 27 says: > beforeEach() may not be used in a describe block containing no tests. Signed-off-by: Janusz Dziurzynski <rzyns@users.noreply.github.com>
Signed-off-by: Janusz Dziurzynski <rzyns@users.noreply.github.com>
Would it be worth updating jest-build-transform.ts to iterate over jestOptions.config.roots instead of hardcoding to package src? I have a modified version of the jest plugin for 27. which does that so we can keep our deployment code separate from our shipping code. |
Yeah, that's a good idea, @ErikMikkelson. Maybe that should be done in a separate PR, though? At this point, I just really, really want modern Jest support in main-line Rush, so I figured I'd try to change as little as possible in this PR. But if you have a specific example of what you want to see and you're inclined to share it, please do send it my way. In either case, I'll poke around a bit more in |
You're right, @rzyns , I don't want to derail your PR. I can set up a PR later. If you're curious, the code was in jest-build-transform, you just wrap the process with something like
The only other place to change is the jest config, of course. |
…jest-27 Signed-off-by: Janusz Dziurzynski <rzyns@users.noreply.github.com>
…st-27 Signed-off-by: Janusz Dziurzynski <rzyns@users.noreply.github.com>
Jest 27 has been released with @rushstack/heft-jest-plugin@0.2.0 |
Summary
This updates the Jest dependency to the latest (
~27.3.1
) jest libraries.Details
There are some breaking changes, which is to be expected when jumping two whole major versions. I'm not sure I've uncovered them all, the only one that seems to have affected the projects I've tested this on is disallowing
done()
callbacks in tests defined by asynchronous functions. I haven't measured performance quantitatively, but it feels like my builds are running faster with this change :)How it was tested
rush update && rush rebuild
in a fresh clonerush update && rush rebuild
many times to iteratively address the breaking changes in jest 27rush rebuild
several times after addressing the breaking changes, and it consistently builds cleanly now