Skip to content

Commit dfe4229

Browse files
authored
cherry-pick(4.3-stable): jest environment detection (#9703) (#9869)
## Summary Cherry-picking for Reanimated 4.3.2 release - #9703 Only the `react-native-reanimated` hunk is picked - the worklets part can't ship through a Reanimated release.
1 parent 5d38250 commit dfe4229

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • packages/react-native-reanimated/src/common/constants

packages/react-native-reanimated/src/common/constants/platform.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ export const IS_ANDROID: boolean = /* @__PURE__ */ (() =>
1313
Platform?.OS === 'android')();
1414
export const IS_IOS: boolean = /* @__PURE__ */ (() => Platform?.OS === 'ios')();
1515
export const IS_WEB: boolean = Platform?.OS === 'web';
16-
export const IS_JEST: boolean = !!process.env.JEST_WORKER_ID;
16+
export const IS_JEST: boolean =
17+
typeof globalThis.jest !== 'undefined' || process.env.NODE_ENV === 'test';
1718
/** @knipIgnore */
1819
export const IS_WINDOWS: boolean = Platform?.OS === 'windows';
1920

0 commit comments

Comments
 (0)