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

fix: update to @jest/create-cache-key-function@27 #30637

Closed
wants to merge 2 commits into from

Conversation

SimenB
Copy link
Contributor

@SimenB SimenB commented Dec 23, 2020

Summary

API of Jest transformers is changing in Jest 27. The new version of @jest/create-cache-key-function handles both current versions of the API and the upcoming 27 API.

Ref: jestjs/jest#10834

Changelog

[Internal] [Changed] - Use version of @jest/create-cache-key-function compatible with upcoming Jest v27 release

Test Plan

I've tested locally that it works with both a jest@latest and jest@next release.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 23, 2020
@pull-bot
Copy link

pull-bot commented Dec 23, 2020

Warnings
⚠️ 🔒 package.json - Changes were made to package.json. This will require a manual import by a Facebook employee.

Generated by 🚫 dangerJS against ed4eee6

Copy link
Contributor

@thymikee thymikee left a comment

Choose a reason for hiding this comment

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

👍🏼

@SimenB
Copy link
Contributor Author

SimenB commented May 25, 2021

Unfortunate this hasn't made it in 6 months after I opened the PR... Anyways, 27 is released as latest now, so I've updated this PR

@SimenB SimenB changed the title fix: update to @jest/create-cache-key-function@next fix: update to @jest/create-cache-key-function@27 May 28, 2021
@DoctorJohn
Copy link

Is there anyone we could ping to get a review of this PR?

@thymikee
Copy link
Contributor

Just pinged some folks, let's hope they can prioritize this. In the meantime, @SimenB would you mind resolving the conflict?

Copy link
Member

@rickhanlonii rickhanlonii left a comment

Choose a reason for hiding this comment

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

LGTM

@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

@hramos merged this pull request in 2f477b1.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Jun 2, 2021
@SimenB SimenB deleted the jest-cache-key-next branch June 2, 2021 14:18
motiz88 added a commit to motiz88/react-native that referenced this pull request Jun 4, 2021
Summary:
CircleCI's Windows executor currently ships with a pre-LTS release of Node v12, breaking our Windows jobs ([example](https://app.circleci.com/pipelines/github/facebook/react-native/9280/workflows/21e6e59c-d853-47a1-af62-1368c8ce10ce/jobs/203983)) following facebook#30637, ultimately due to jestjs/jest#10685 dropping support for non-LTS versions in the Node v12 release line.

Luckily, the Windows executor [does ship with nvm](circleci/circleci-docs#3733) so we can use that to install a desired Node version. Rather than just pinning a later v12 release that is LTS, we align the Windows config with the one for non-Windows jobs (in the `nodelts` executor) by running against the latest available Node v14 release.

Changelog:
[Internal]

Differential Revision: D28896581

fbshipit-source-id: bd9dd3eb1921f7ab28f05088db23a54cf1a6478d
motiz88 added a commit to motiz88/react-native that referenced this pull request Jun 4, 2021
Summary:
Pull Request resolved: facebook#31656

CircleCI's Windows executor currently ships with a pre-LTS release of Node v12, breaking our Windows jobs ([example](https://app.circleci.com/pipelines/github/facebook/react-native/9280/workflows/21e6e59c-d853-47a1-af62-1368c8ce10ce/jobs/203983)) following facebook#30637, ultimately due to jestjs/jest#10685 dropping support for non-LTS versions in the Node v12 release line.

Luckily, the Windows executor [does ship with nvm](circleci/circleci-docs#3733) so we can use that to install a desired Node version. Rather than just pinning a later v12 release that is LTS, we align the Windows config with the one for non-Windows jobs (in the `nodelts` executor) by running against the latest available Node v14 release.

Changelog:
[Internal]

Differential Revision: D28896581

fbshipit-source-id: ed490bcdae80e736338c387e255191d8be1888cb
motiz88 added a commit to motiz88/react-native that referenced this pull request Jun 4, 2021
Summary:
Pull Request resolved: facebook#31656

CircleCI's Windows executor currently ships with a pre-LTS release of Node v12, breaking our Windows jobs ([example](https://app.circleci.com/pipelines/github/facebook/react-native/9280/workflows/21e6e59c-d853-47a1-af62-1368c8ce10ce/jobs/203983)) following facebook#30637, ultimately due to jestjs/jest#10685 dropping support for non-LTS versions in the Node v12 release line.

Luckily, the Windows executor [does ship with nvm](circleci/circleci-docs#3733) so we can use that to install a desired Node version. Rather than just pinning a later v12 release that is LTS, we align the Windows config with the one for non-Windows jobs (in the `nodelts` executor) by running against the latest available Node v14 release.

Changelog:
[Internal]

Differential Revision: D28896581

fbshipit-source-id: cdcf9341e265e3bf28457d3e91c26d76a1dbb82a
motiz88 added a commit to motiz88/react-native that referenced this pull request Jun 4, 2021
Summary:
Pull Request resolved: facebook#31656

CircleCI's Windows executor currently ships with a pre-LTS release of Node v12, breaking our Windows jobs ([example](https://app.circleci.com/pipelines/github/facebook/react-native/9280/workflows/21e6e59c-d853-47a1-af62-1368c8ce10ce/jobs/203983)) following facebook#30637, ultimately due to jestjs/jest#10685 dropping support for non-LTS versions in the Node v12 release line.

Luckily, the Windows executor [does ship with nvm](circleci/circleci-docs#3733) so we can use that to install a desired Node version. Rather than just pinning a later v12 release that is LTS, we pin a v14 release that is currently the most recent LTS version.

NOTE: The nvm on CircleCI is https://github.com/coreybutler/nvm-windows, not https://github.com/nvm-sh/nvm, and the two aren't interchangeable. [nvm-windows has no functionality to install the latest version of a release line](coreybutler/nvm-windows#156) so we're forced to specify an exact version, which will need to be bumped manually in the future. This isn't great, but IMO it's no worse than the current situation, where we use whichever stale version of Node happens to be bundled with the Windows CircleCI executor.

Changelog:
[Internal]

Differential Revision: D28896581

fbshipit-source-id: abf3b56a256f89374add1c01ae6b99a8ba234112
facebook-github-bot pushed a commit that referenced this pull request Jun 4, 2021
Summary:
Pull Request resolved: #31656

CircleCI's Windows executor currently ships with a pre-LTS release of Node v12, breaking our Windows jobs ([example](https://app.circleci.com/pipelines/github/facebook/react-native/9280/workflows/21e6e59c-d853-47a1-af62-1368c8ce10ce/jobs/203983)) following #30637, ultimately due to jestjs/jest#10685 dropping support for non-LTS versions in the Node v12 release line.

Luckily, the Windows executor [does ship with nvm](circleci/circleci-docs#3733) so we can use that to install a desired Node version. Rather than just pinning a later v12 release that is LTS, we pin a v14 release that is currently the most recent LTS version.

NOTE: The nvm on CircleCI is https://github.com/coreybutler/nvm-windows, not https://github.com/nvm-sh/nvm, and the two aren't interchangeable. [nvm-windows has no functionality to install the latest version of a release line](coreybutler/nvm-windows#156) so we're forced to specify an exact version, which will need to be bumped manually in the future. This isn't great, but IMO it's no worse than the current situation, where we use whichever stale version of Node happens to be bundled with the Windows CircleCI executor.

Changelog:
[Internal]

Reviewed By: GijsWeterings

Differential Revision: D28896581

fbshipit-source-id: a412376cf36054de49efa49866fe60dd964567c5
Titozzz pushed a commit to Titozzz/react-native that referenced this pull request Jun 7, 2021
Summary:
API of Jest transformers is changing in Jest 27. The new version of `jest/create-cache-key-function` handles both current versions of the API and the upcoming 27 API.

Ref: jestjs/jest#10834

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Internal] [Changed] - Use version of `jest/create-cache-key-function` compatible with upcoming Jest v27 release

Pull Request resolved: facebook#30637

Test Plan: I've tested locally that it works with both a `jest@latest` and `jest@next` release.

Reviewed By: yungsters

Differential Revision: D28807361

Pulled By: hramos

fbshipit-source-id: 9d9ccb4d7f91b30bcbf3d28202bb74ce7499a91b
tido64 pushed a commit that referenced this pull request Jun 8, 2021
Summary:
API of Jest transformers is changing in Jest 27. The new version of `jest/create-cache-key-function` handles both current versions of the API and the upcoming 27 API.

Ref: jestjs/jest#10834

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Internal] [Changed] - Use version of `jest/create-cache-key-function` compatible with upcoming Jest v27 release

Pull Request resolved: #30637

Test Plan: I've tested locally that it works with both a `jest@latest` and `jest@next` release.

Reviewed By: yungsters

Differential Revision: D28807361

Pulled By: hramos

fbshipit-source-id: 9d9ccb4d7f91b30bcbf3d28202bb74ce7499a91b
carloscuesta added a commit to carloscuesta/react-native-error-boundary that referenced this pull request Jun 20, 2021
carloscuesta added a commit to carloscuesta/react-native-error-boundary that referenced this pull request Jun 20, 2021
* ⬆️ Bump jest from 26.6.3 to 27.0.4

Bumps [jest](https://github.com/facebook/jest) from 26.6.3 to 27.0.4.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/master/CHANGELOG.md)
- [Commits](jestjs/jest@v26.6.3...v27.0.4)

---
updated-dependencies:
- dependency-name: jest
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix Jest cache error

Related with facebook/react-native#30637

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Carlos Cuesta <carloscuesta@me.com>
Setito pushed a commit to Setito/react-native that referenced this pull request Jul 17, 2021
Summary:
Pull Request resolved: facebook#31656

CircleCI's Windows executor currently ships with a pre-LTS release of Node v12, breaking our Windows jobs ([example](https://app.circleci.com/pipelines/github/facebook/react-native/9280/workflows/21e6e59c-d853-47a1-af62-1368c8ce10ce/jobs/203983)) following facebook#30637, ultimately due to jestjs/jest#10685 dropping support for non-LTS versions in the Node v12 release line.

Luckily, the Windows executor [does ship with nvm](circleci/circleci-docs#3733) so we can use that to install a desired Node version. Rather than just pinning a later v12 release that is LTS, we pin a v14 release that is currently the most recent LTS version.

NOTE: The nvm on CircleCI is https://github.com/coreybutler/nvm-windows, not https://github.com/nvm-sh/nvm, and the two aren't interchangeable. [nvm-windows has no functionality to install the latest version of a release line](coreybutler/nvm-windows#156) so we're forced to specify an exact version, which will need to be bumped manually in the future. This isn't great, but IMO it's no worse than the current situation, where we use whichever stale version of Node happens to be bundled with the Windows CircleCI executor.

Changelog:
[Internal]

Reviewed By: GijsWeterings

Differential Revision: D28896581

fbshipit-source-id: a412376cf36054de49efa49866fe60dd964567c5
@damdafayton
Copy link

damdafayton commented Mar 13, 2024

Facing same error with:
"jest": "^29.5.0",
"@testing-library/react-native": "^12.4.3",
"react": "^17.0.1",
"react-dom": "17.0.1",
"react-native": "0.64.4",

Error occurs if the file has "Image" component which does "require" a local asset.
Such as:
<Image source={require("../../assets/images/attachment.png")} style={{ height: 18, width: 18, marginBottom: 4, }} />

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. Merged This PR has been merged. Needs: React Native Team Attention
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants