Skip to content

Commit a206497

Browse files
yungstersfacebook-github-bot
authored andcommitted
RN: Configure Jest for React 19
Summary: Enables these 2 global feature flags for React Native Jest testing: - `IS_REACT_ACT_ENVIRONMENT` - `IS_REACT_NATIVE_TEST_ENVIRONMENT` Changelog: [General][Changed] - Enables React global flag that causes Jest testing environment to require `act()` Differential Revision: D58644562
1 parent cf0e6af commit a206497

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/react-native/jest/setup.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99

1010
'use strict';
1111

12+
global.IS_REACT_ACT_ENVIRONMENT = true;
13+
// Suppress the `react-test-renderer` warnings until New Architecture and legacy
14+
// mode are no longer supported by React Native.
15+
global.IS_REACT_NATIVE_TEST_ENVIRONMENT = true;
16+
1217
const MockNativeMethods = jest.requireActual('./MockNativeMethods');
1318
const mockComponent = jest.requireActual('./mockComponent');
1419

0 commit comments

Comments
 (0)