fix: define IS_ACT_ENVIRONMENT global for tests with concurrent mode and synchronous act (#28296)

This commit is contained in:
Ruslan Lesiutin
2024-02-09 19:03:40 +00:00
committed by GitHub
parent 8a87445d01
commit 4693e87e2d
5 changed files with 10 additions and 6 deletions
@@ -20,6 +20,8 @@ describe('Fast Refresh', () => {
let withErrorsOrWarningsIgnored;
beforeEach(() => {
global.IS_REACT_ACT_ENVIRONMENT = true;
exportsObj = undefined;
babel = require('@babel/core');
@@ -17,6 +17,8 @@ describe('ProfilerStore', () => {
let utils;
beforeEach(() => {
global.IS_REACT_ACT_ENVIRONMENT = true;
utils = require('./utils');
utils.beforeEachProfiling();
@@ -23,6 +23,8 @@ describe('Store', () => {
let withErrorsOrWarningsIgnored;
beforeEach(() => {
global.IS_REACT_ACT_ENVIRONMENT = true;
agent = global.agent;
bridge = global.bridge;
store = global.store;
@@ -17,6 +17,8 @@ describe('StoreStressConcurrent', () => {
let print;
beforeEach(() => {
global.IS_REACT_ACT_ENVIRONMENT = true;
bridge = global.bridge;
store = global.store;
store.collapseNodesByDefault = false;
@@ -31,12 +33,6 @@ describe('StoreStressConcurrent', () => {
print = require('./__serializers__/storeSerializer').print;
});
// TODO: Remove this in favor of @gate pragma
if (!__EXPERIMENTAL__) {
it("empty test so Jest doesn't complain", () => {});
return;
}
// This is a stress test for the tree mount/update/unmount traversal.
// It renders different trees that should produce the same output.
// @reactVersion >= 18.0
@@ -33,6 +33,8 @@ describe('TreeListContext', () => {
let state: StateContext;
beforeEach(() => {
global.IS_REACT_ACT_ENVIRONMENT = true;
utils = require('./utils');
utils.beforeEachProfiling();