From 7d2ef7815d92db9bb04460212794ef5da51de0ac Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Thu, 9 Jul 2026 02:52:03 -0700 Subject: [PATCH] Fix HelloWorld Jest preset after react-native/jest-preset removal (#57491) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: https://github.com/react/react-native/issues/57481 removed the `react-native/jest-preset.js` redirect module (and the `react-native/jest-preset` public export), but the in-repo `private/helloworld` app still referenced `preset: 'react-native'` in its Jest config. This breaks `yarn test` in the `test_ios_helloworld` CI job (which cascade-cancels the rest of the iOS matrix and turns the e2e retry `report` jobs red): ``` ● Validation Error: Module react-native should have "jest-preset.js" or "jest-preset.json" file at the root. ``` This migrates HelloWorld to the standalone `react-native/jest-preset` package — the documented migration path (see `packages/jest-preset/README.md`). ## Changes - `private/helloworld/jest.config.js`: `preset: 'react-native'` → `preset: 'react-native/jest-preset'` - `private/helloworld/package.json`: add `react-native/jest-preset` devDependency (`0.87.0-main`, matching the sibling `react-native/*` packages) ## Changelog: [Internal] [Fixed] - Fix HelloWorld Jest preset after `react-native/jest-preset` removal Pull Request resolved: https://github.com/react/react-native/pull/57491 Test Plan: - `cd private/helloworld && yarn test` resolves the preset and runs (previously failed with the validation error above). - CI `test_ios_helloworld` job. Reviewed By: cortinico Differential Revision: D111215532 Pulled By: cipolleschi fbshipit-source-id: 2d60de619060e384b4a5b662a6f588ea3e368433 --- private/helloworld/jest.config.js | 2 +- private/helloworld/package.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/private/helloworld/jest.config.js b/private/helloworld/jest.config.js index 26ef92b73ce..3b10bdf375d 100644 --- a/private/helloworld/jest.config.js +++ b/private/helloworld/jest.config.js @@ -9,5 +9,5 @@ */ module.exports = { - preset: 'react-native', + preset: '@react-native/jest-preset', }; diff --git a/private/helloworld/package.json b/private/helloworld/package.json index 63cdc897f1e..d75b1f9e56a 100644 --- a/private/helloworld/package.json +++ b/private/helloworld/package.json @@ -22,6 +22,7 @@ "@react-native/babel-preset": "0.87.0-main", "@react-native/core-cli-utils": "*", "@react-native/eslint-config": "0.87.0-main", + "@react-native/jest-preset": "0.87.0-main", "@react-native/metro-config": "0.87.0-main", "@react-native/typescript-config": "0.87.0-main", "@types/jest": "^29.5.14",