| 1 | 'use strict'; |
| 2 | |
| 3 | jest.mock('shared/ReactFeatureFlags', () => { |
| 4 | jest.mock( |
| 5 | 'ReactNativeInternalFeatureFlags', |
| 6 | () => |
| 7 | jest.requireActual('shared/forks/ReactFeatureFlags.native-fb-dynamic.js'), |
| 8 | {virtual: true} |
| 9 | ); |
| 10 | const actual = jest.requireActual( |
| 11 | 'shared/forks/ReactFeatureFlags.native-fb.js' |
| 12 | ); |
| 13 | |
| 14 | // Lots of tests use these, but we don't want to expose it to RN. |
| 15 | // Ideally, tests for xplat wouldn't use react-dom, but many of our tests do. |
| 16 | // Since the xplat tests run with the www entry points, some of these flags |
| 17 | // need to be set to the www value for the entrypoint, otherwise gating would |
| 18 | // fail due to the tests passing. Ideally, the www entry points for these APIs |
| 19 | // would be gated, and then these would fail correctly. |
| 20 | actual.enableLegacyCache = true; |
| 21 | actual.enableLegacyHidden = true; |
| 22 | actual.enableScopeAPI = true; |
| 23 | actual.enableTaint = false; |
| 24 | |
| 25 | // Some value that doesn't impact existing tests |
| 26 | actual.ownerStackLimit = __VARIANT__ ? 500 : 1e4; |
| 27 | |
| 28 | return actual; |
| 29 | }); |
| 30 | |
| 31 | global.__PERSISTENT__ = true; |
| 32 | global.__XPLAT__ = true; |