Skip to content

Commit 2f83490

Browse files
committed
Fix helloworld Jest preset after react-native/jest-preset subpath removal
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`).
1 parent d6baa43 commit 2f83490

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

private/helloworld/jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
*/
1010

1111
module.exports = {
12-
preset: 'react-native',
12+
preset: '@react-native/jest-preset',
1313
};

private/helloworld/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"@react-native/babel-preset": "0.87.0-rc.0",
2323
"@react-native/core-cli-utils": "*",
2424
"@react-native/eslint-config": "0.87.0-rc.0",
25+
"@react-native/jest-preset": "0.87.0-rc.0",
2526
"@react-native/metro-config": "0.87.0-rc.0",
2627
"@react-native/typescript-config": "0.87.0-rc.0",
2728
"@types/jest": "^29.5.14",

0 commit comments

Comments
 (0)