[0.87] Fix helloworld Jest preset after react-native/jest-preset subpath removal#57539
Merged
Conversation
…oval Summary: #57481 removed the `react-native/jest-preset` subpath redirect, but the in-repo `private/helloworld` template still referenced `preset: 'react-native'`, which Jest resolves to the now-deleted `react-native/jest-preset.js`. This broke all `test_ios_helloworld*` CI jobs on 0.87-stable at the `yarn test` step: Validation Error: Module react-native should have "jest-preset.js" or "jest-preset.json" file at the root. Since `private/helloworld` is excluded from the yarn workspace and installed standalone, it also needs `@react-native/jest-preset` as an explicit devDependency for the preset to resolve. - Point jest.config.js preset at `@react-native/jest-preset`. - Add `@react-native/jest-preset` to devDependencies. Changelog: [Internal] Test Plan: CI: `test_ios_helloworld*` jobs pass (previously failing at `yarn test`).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog
[Internal] - Fix helloworld Jest preset on 0.87-stable
Summary
#57481 (landed via #57508) removed the
react-native/jest-presetsubpath redirect, but the in-repoprivate/helloworldtemplate still referencedpreset: 'react-native', which Jest resolves to the now-deletedreact-native/jest-preset.js.This broke all
test_ios_helloworld*jobs on0.87-stableat theyarn teststep (e.g. run 29279033977):Since
private/helloworldis excluded from the yarn workspace ("!private/helloworld") and installed standalone, it also needs@react-native/jest-presetas an explicitdevDependencyfor the preset to resolve.Changes
private/helloworld/jest.config.jspreset at@react-native/jest-preset.@react-native/jest-presettoprivate/helloworlddevDependencies.This mirrors the shipped community template and the current CLI-generated scaffold.
Test Plan
CI:
test_ios_helloworld*jobs pass (previously failing atyarn test).