Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ describe('Fast Refresh', () => {
let withErrorsOrWarningsIgnored;

beforeEach(() => {
global.IS_REACT_ACT_ENVIRONMENT = true;

exportsObj = undefined;

babel = require('@babel/core');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ describe('ProfilerStore', () => {
let utils;

beforeEach(() => {
global.IS_REACT_ACT_ENVIRONMENT = true;

utils = require('./utils');
utils.beforeEachProfiling();

Expand Down
2 changes: 2 additions & 0 deletions packages/react-devtools-shared/src/__tests__/store-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ describe('Store', () => {
let withErrorsOrWarningsIgnored;

beforeEach(() => {
global.IS_REACT_ACT_ENVIRONMENT = true;

agent = global.agent;
bridge = global.bridge;
store = global.store;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ describe('StoreStressConcurrent', () => {
let print;

beforeEach(() => {
global.IS_REACT_ACT_ENVIRONMENT = true;

bridge = global.bridge;
store = global.store;
store.collapseNodesByDefault = false;
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ describe('TreeListContext', () => {
let state: StateContext;

beforeEach(() => {
global.IS_REACT_ACT_ENVIRONMENT = true;

utils = require('./utils');
utils.beforeEachProfiling();

Expand Down