Don't rely on inline requires to apply mocks in JS tests #59307

Closed
robhogan opened 1:16pm on October 21, 2026 wanted to merge 50 Δ into facebook/react-native main from
robhogan/jest-mocks-without-inline-requires

Pull request #59307 quality checks

Code files and functions touched by this pull request are analyzed below.

Quality targets

How does this pull request compare to chosen code quality targets? Read more about code quality targets.

Target name Target value This PR
Maximum Diff Delta per PR 500 50
Maximum comment count per PR 10 4
Pull request maximum business days between activity 3 14
Pull request maximum business days open 5 15

Coupled files

Are there any files from this commit that are always committed alongside another file? This often suggests that there exists code coupling to potentially remove. Read more about code coupling

Committed together % Code file
Coupled code file
Commits in PR with both
83 packages/react-native/Libraries/LogBox/__tests__/LogBoxNotificationContainer-test.js
packages/react-native/Libraries/LogBox/__tests__/LogBoxInspectorContainer-test.js
1
71 packages/react-native/Libraries/LogBox/__tests__/LogBoxInspectorContainer-test.js
packages/react-native/Libraries/LogBox/__tests__/LogBoxNotificationContainer-test.js
1

Biggest files changes in pull request

Path View whole file Lines removed Lines added Final line count
packages/react-native/scripts/ios-prebuild/__tests__/headers-xcframework-test.js 0 0 120
scripts/releases-ci/__tests__/publish-npm-test.js 0 0 509
packages/react-native-codegen/src/parsers/__tests__/parsers-commons-test.js 0 0 1733
packages/react-native/Libraries/Animated/__tests__/Animated-test.js 0 0 1300
scripts/releases/__tests__/upload-release-assets-for-dotslash-test.js 0 0 351
packages/react-native/scripts/swiftpm/__tests__/prepare-app-utils-test.js 0 0 1636
.github/workflow-scripts/__tests__/verifyArtifactsAreOnMaven-test.js 0 0 130
scripts/releases/utils/__tests__/scm-utils-test.js 0 0 58
packages/react-native/scripts/swiftpm/__tests__/headers-utils-test.js 0 0 1210
.github/workflow-scripts/__tests__/publishTemplate-test.js 0 0 129
.github/workflow-scripts/__tests__/verifyReleaseOnNpm-test.js 0 0 109
packages/react-native/Libraries/LogBox/__tests__/LogBoxInspectorContainer-test.js 0 0 168
scripts/releases/utils/__tests__/npm-utils-test.js 0 0 99
scripts/releases-ci/__tests__/publish-updated-packages-test.js 0 0 278
packages/react-native/Libraries/LogBox/__tests__/LogBoxNotificationContainer-test.js 0 0 362
.github/workflow-scripts/__tests__/verifyPublishedPackage-test.js 0 0 135

️ Biggest functions grown or shrunk by pull request

Which functions had their line count change as part of this pull request?

Could not find any functions changed by this pull request.