Skip to content

Commit 374fd68

Browse files
authored
fix: define IS_ACT_ENVIRONMENT global for tests with concurrent mode and synchronous act (#28296)
1 parent d27c1ac commit 374fd68

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

packages/react-devtools-shared/src/__tests__/FastRefreshDevToolsIntegration-test.js

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ describe('Fast Refresh', () => {
2020
let withErrorsOrWarningsIgnored;
2121

2222
beforeEach(() => {
23+
global.IS_REACT_ACT_ENVIRONMENT = true;
24+
2325
exportsObj = undefined;
2426

2527
babel = require('@babel/core');

packages/react-devtools-shared/src/__tests__/profilerStore-test.js

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ describe('ProfilerStore', () => {
1717
let utils;
1818

1919
beforeEach(() => {
20+
global.IS_REACT_ACT_ENVIRONMENT = true;
21+
2022
utils = require('./utils');
2123
utils.beforeEachProfiling();
2224

packages/react-devtools-shared/src/__tests__/store-test.js

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ describe('Store', () => {
2323
let withErrorsOrWarningsIgnored;
2424

2525
beforeEach(() => {
26+
global.IS_REACT_ACT_ENVIRONMENT = true;
27+
2628
agent = global.agent;
2729
bridge = global.bridge;
2830
store = global.store;

packages/react-devtools-shared/src/__tests__/storeStressTestConcurrent-test.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ describe('StoreStressConcurrent', () => {
1717
let print;
1818

1919
beforeEach(() => {
20+
global.IS_REACT_ACT_ENVIRONMENT = true;
21+
2022
bridge = global.bridge;
2123
store = global.store;
2224
store.collapseNodesByDefault = false;
@@ -31,12 +33,6 @@ describe('StoreStressConcurrent', () => {
3133
print = require('./__serializers__/storeSerializer').print;
3234
});
3335

34-
// TODO: Remove this in favor of @gate pragma
35-
if (!__EXPERIMENTAL__) {
36-
it("empty test so Jest doesn't complain", () => {});
37-
return;
38-
}
39-
4036
// This is a stress test for the tree mount/update/unmount traversal.
4137
// It renders different trees that should produce the same output.
4238
// @reactVersion >= 18.0

packages/react-devtools-shared/src/__tests__/treeContext-test.js

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ describe('TreeListContext', () => {
3333
let state: StateContext;
3434

3535
beforeEach(() => {
36+
global.IS_REACT_ACT_ENVIRONMENT = true;
37+
3638
utils = require('./utils');
3739
utils.beforeEachProfiling();
3840

0 commit comments

Comments
 (0)