mirror of
https://github.com/hanzoai/react.git
synced 2026-09-24 17:02:27 +00:00
fix: define IS_ACT_ENVIRONMENT global for tests with concurrent mode and synchronous act (#28296)
This commit is contained in:
+2
@@ -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;
|
||||
|
||||
+2
-6
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user