Fix ownerStackLimit feature gating for tests (#32726)

https://github.com/facebook/react/pull/32529 added a dynamic flag for
this, but that breaks tests since the flags are not defined everywhere.

However, this is a static value and the flag is only for supporting
existing tests. So we can override it in the test config, and make it
static at built time instead.
This commit is contained in:
Ricky
2025-03-26 12:01:05 -04:00
committed by GitHub
parent 8ac25e5201
commit f99c9feaf7
6 changed files with 9 additions and 11 deletions

View File

@@ -17,6 +17,9 @@ jest.mock('shared/ReactFeatureFlags', () => {
// we remove the flag.
actual.disableClientCache = __VARIANT__;
// Some value that doesn't impact existing tests
actual.ownerStackLimit = __VARIANT__ ? 500 : 1e4;
return actual;
});

View File

@@ -22,6 +22,9 @@ jest.mock('shared/ReactFeatureFlags', () => {
actual.enableScopeAPI = true;
actual.enableTaint = false;
// Some value that doesn't impact existing tests
actual.ownerStackLimit = __VARIANT__ ? 500 : 1e4;
return actual;
});