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(jest): bump jest to 29 in the template #34972

Closed
wants to merge 1 commit into from

Conversation

kelset
Copy link
Collaborator

@kelset kelset commented Oct 13, 2022

Summary

This PR is the follow up of #34724 for the template; this way, we'll have version alignment and RN71 will use this.

This wants to be merged along #34971

Changelog

[General] [Changed] - upgrade Jest in template to 29

Test Plan

Generated a test project via yarn test-e2e-local -t RNTestProject and then run yarn test in that project to verify that there's no regression. ✅

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Contributor A React Native contributor. p: Microsoft Partner: Microsoft Partner labels Oct 13, 2022
@kelset kelset requested a review from robhogan October 13, 2022 16:49
@analysis-bot
Copy link

analysis-bot commented Oct 13, 2022

Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: a63a4fa
Branch: main

@@ -17,9 +17,9 @@
"@babel/core": "^7.12.9",
"@babel/runtime": "^7.12.5",
"@react-native-community/eslint-config": "^3.0.0",
"babel-jest": "^26.6.3",
"babel-jest": "^29.0.3",
Copy link
Contributor

Choose a reason for hiding this comment

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

I just released 29.2.0 fwiw. But I guess these versions mirror some internal version and should remain in sync with that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah I want to keep the versioning consistent across the entire repo

Copy link
Contributor

Choose a reason for hiding this comment

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

makes sense 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

Keeping them consistent makes sense, but I would like to bump all of them to at least 29.1.0 before 0.71, because jest.now() is important for properly mocking (legacy) fake timer animations.

I'll pull this in and then have a go at bumping internally across the monorepo. Should be smooth, right? 🤞

Copy link
Contributor

Choose a reason for hiding this comment

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

hopefully! 😀

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it will :) just need a few mins to push a change in the other PR then they should be good to go 👍

@facebook-github-bot
Copy link
Contributor

@robhogan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@analysis-bot
Copy link

analysis-bot commented Oct 17, 2022

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 7,778,640 +1,538
android hermes armeabi-v7a 7,181,063 +625
android hermes x86 8,092,607 +781
android hermes x86_64 8,063,546 +759
android jsc arm64-v8a 9,637,472 +1,534
android jsc armeabi-v7a 8,401,772 +642
android jsc x86 9,586,662 +805
android jsc x86_64 10,179,829 +766

Base commit: a63a4fa
Branch: main

@facebook-github-bot
Copy link
Contributor

@robhogan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot pushed a commit that referenced this pull request Oct 17, 2022
…34971)

Summary:
This PR is the follow up to the conversation started here by SimenB: react-native-community/discussions-and-proposals#509

Basically, we want to move RN to use its own custom environment so that we can tweak it going forward - this PR in fact only sets up the groundwork for that; robhogan mentioned that with this in place, Meta engineers can
> iterate on it (with jest-environment-node as a starting point) against our internal product tests

This is also connected to Rob's work to bring Jest 29 into the codebase #34724 and my "mirror" PR to bring template in main up to the same version (#34972)

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[General] [Changed] - move Jest config to use a custom react-native Jest env

Pull Request resolved: #34971

Test Plan: Tested that `yarn test` in main works fine after the changes; CI and Meta's internal CI will also serve the purpose of verifying that it works (but there's no reason not to since it's still pretty much just relying on `node`).

Reviewed By: huntie

Differential Revision: D40379760

Pulled By: robhogan

fbshipit-source-id: 2c6d0bc86d337fda9befce0799bda2f56cc4466c
@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @kelset in 8f33753.

When will my fix make it into a release? | Upcoming Releases

@react-native-bot react-native-bot added the Merged This PR has been merged. label Oct 18, 2022
@kelset kelset deleted the kelset/bump-jest-to-29 branch October 18, 2022 11:53
@SimenB
Copy link
Contributor

SimenB commented Oct 18, 2022

🎉

@robhogan
Copy link
Contributor

I'm just a touch nervous about this because I'm seeing internal test breakages on 29.2.0 that were working on 29.0.3, which I think is down to jestjs/jest#13398.

Still working to confirm, but @SimenB, let us know if we can help in any way with that. I'd be keen to bump the minimum template version to a release past that bug before the 0.71 cut (or alternatively, go to ~29.1.2 so that users don't pull 29.2.0)

@SimenB
Copy link
Contributor

SimenB commented Oct 18, 2022

Yeah, currently reverting 👍 and adding regression tests

@SimenB
Copy link
Contributor

SimenB commented Oct 18, 2022

@robhogan would you be able to apply jestjs/jest#13472 internally?

@SimenB
Copy link
Contributor

SimenB commented Oct 18, 2022

Actually I'll release it (need a Node 19 fix). If it still doesn't work, a reproduction would be great 😀

@robhogan
Copy link
Contributor

@robhogan would you be able to apply facebook/jest#13472 internally?

Yes - works for us!

@SimenB
Copy link
Contributor

SimenB commented Oct 18, 2022

Sweet, thanks!

https://github.com/facebook/jest/releases/tag/v29.2.1

@kelset
Copy link
Collaborator Author

kelset commented Oct 18, 2022

lmk if there's anything I need to do on my end :)

@robhogan
Copy link
Contributor

lmk if there's anything I need to do on my end :)

All good - just need to pull in #35014 before the 71 cut.

facebook-github-bot pushed a commit to facebook/metro that referenced this pull request Oct 19, 2022
Summary:
X-link: facebook/react-native#35014

Pull Request resolved: #881

Following on from facebook/react-native#34724 and facebook/react-native#34972, this updates Jest to the latest version 29.2.1 across projects and in the OSS React Native new app template.

Importantly this version includes the [new `jest.now()` API](jestjs/jest#13245), which will be useful for exposing internally consistent fake timer mocks of `requestAnimationFrame`, etc., in the new React Native Jest environment.

Changelog:
[General] [Changed] - Upgrade Jest in React Native template to ^29.2.1

Reviewed By: jacdebug

Differential Revision: D40386349

fbshipit-source-id: 43f5a69cf546df09e2f02542ebf50130d65f0436
facebook-github-bot pushed a commit that referenced this pull request Oct 19, 2022
Summary:
Pull Request resolved: #35014

X-link: facebook/metro#881

Following on from #34724 and #34972, this updates Jest to the latest version 29.2.1 across projects and in the OSS React Native new app template.

Importantly this version includes the [new `jest.now()` API](jestjs/jest#13245), which will be useful for exposing internally consistent fake timer mocks of `requestAnimationFrame`, etc., in the new React Native Jest environment.

Changelog:
[General] [Changed] - Upgrade Jest in React Native template to ^29.2.1

Reviewed By: jacdebug

Differential Revision: D40386349

fbshipit-source-id: 43f5a69cf546df09e2f02542ebf50130d65f0436
OlimpiaZurek pushed a commit to OlimpiaZurek/react-native that referenced this pull request May 22, 2023
…acebook#34971)

Summary:
This PR is the follow up to the conversation started here by SimenB: react-native-community/discussions-and-proposals#509

Basically, we want to move RN to use its own custom environment so that we can tweak it going forward - this PR in fact only sets up the groundwork for that; robhogan mentioned that with this in place, Meta engineers can
> iterate on it (with jest-environment-node as a starting point) against our internal product tests

This is also connected to Rob's work to bring Jest 29 into the codebase facebook#34724 and my "mirror" PR to bring template in main up to the same version (facebook#34972)

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[General] [Changed] - move Jest config to use a custom react-native Jest env

Pull Request resolved: facebook#34971

Test Plan: Tested that `yarn test` in main works fine after the changes; CI and Meta's internal CI will also serve the purpose of verifying that it works (but there's no reason not to since it's still pretty much just relying on `node`).

Reviewed By: huntie

Differential Revision: D40379760

Pulled By: robhogan

fbshipit-source-id: 2c6d0bc86d337fda9befce0799bda2f56cc4466c
OlimpiaZurek pushed a commit to OlimpiaZurek/react-native that referenced this pull request May 22, 2023
Summary:
This PR is the follow up of facebook#34724 for the template; this way, we'll have version alignment and RN71 will use this.

This wants to be merged along facebook#34971

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[General] [Changed] - upgrade Jest in template to 29

Pull Request resolved: facebook#34972

Test Plan: Generated a test project via `yarn test-e2e-local -t RNTestProject` and then run `yarn test` in that project to verify that there's no regression. ✅

Reviewed By: huntie

Differential Revision: D40379963

Pulled By: robhogan

fbshipit-source-id: 618207ed6bf7921d13f0b6a9220dc52c9cf78b14
OlimpiaZurek pushed a commit to OlimpiaZurek/react-native that referenced this pull request May 22, 2023
Summary:
Pull Request resolved: facebook#35014

X-link: facebook/metro#881

Following on from facebook#34724 and facebook#34972, this updates Jest to the latest version 29.2.1 across projects and in the OSS React Native new app template.

Importantly this version includes the [new `jest.now()` API](jestjs/jest#13245), which will be useful for exposing internally consistent fake timer mocks of `requestAnimationFrame`, etc., in the new React Native Jest environment.

Changelog:
[General] [Changed] - Upgrade Jest in React Native template to ^29.2.1

Reviewed By: jacdebug

Differential Revision: D40386349

fbshipit-source-id: 43f5a69cf546df09e2f02542ebf50130d65f0436
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Contributor A React Native contributor. Merged This PR has been merged. p: Microsoft Partner: Microsoft Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants