From 2f834906f9f25230019177ef2c50ea2bebe33b77 Mon Sep 17 00:00:00 2001 From: Zeya Peng Date: Tue, 14 Jul 2026 10:27:18 +0100 Subject: [PATCH] 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`). --- 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 26ef92b73cee..3b10bdf375da 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 497a5b816b55..946794e99fa8 100644 --- a/private/helloworld/package.json +++ b/private/helloworld/package.json @@ -22,6 +22,7 @@ "@react-native/babel-preset": "0.87.0-rc.0", "@react-native/core-cli-utils": "*", "@react-native/eslint-config": "0.87.0-rc.0", + "@react-native/jest-preset": "0.87.0-rc.0", "@react-native/metro-config": "0.87.0-rc.0", "@react-native/typescript-config": "0.87.0-rc.0", "@types/jest": "^29.5.14",