Skip to content

Commit

Permalink
We are going to remove test-utils and this change moves references to…
Browse files Browse the repository at this point in the history
… act from this entrypoint to react
  • Loading branch information
gnoff committed Dec 6, 2023
1 parent 60ad369 commit 8502b2d
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions fixtures/dom/src/__tests__/nested-act-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('unmocked scheduler', () => {
beforeEach(() => {
jest.resetModules();
React = require('react');
DOMAct = require('react-dom/test-utils').act;
DOMAct = React.unstable_act;
TestRenderer = require('react-test-renderer');
TestAct = TestRenderer.act;
});
Expand Down Expand Up @@ -61,7 +61,7 @@ describe('mocked scheduler', () => {
require.requireActual('scheduler/unstable_mock')
);
React = require('react');
DOMAct = require('react-dom/test-utils').act;
DOMAct = React.unstable_act;
TestRenderer = require('react-test-renderer');
TestAct = TestRenderer.act;
});
Expand Down
4 changes: 2 additions & 2 deletions packages/react-devtools-shared/src/__tests__/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function act(
recursivelyFlush: boolean = true,
): void {
const {act: actTestRenderer} = require('react-test-renderer');
const {act: actDOM} = require('react-dom/test-utils');
const actDOM = require('react').unstable_act;

actDOM(() => {
actTestRenderer(() => {
Expand All @@ -44,7 +44,7 @@ export async function actAsync(
recursivelyFlush: boolean = true,
): Promise<void> {
const {act: actTestRenderer} = require('react-test-renderer');
const {act: actDOM} = require('react-dom/test-utils');
const actDOM = require('react').unstable_act;

await actDOM(async () => {
await actTestRenderer(async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('ReactDOMServerHydration', () => {
React = require('react');
ReactDOMClient = require('react-dom/client');
ReactDOMServer = require('react-dom/server');
act = require('react-dom/test-utils').act;
act = React.unstable_act;

console.error = jest.fn();
container = document.createElement('div');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ beforeEach(() => {
yields = [];
React = require('react');
ReactDOM = require('react-dom');
act = require('react-dom/test-utils').act;
act = React.unstable_act;
container = document.createElement('div');
document.body.appendChild(container);
});
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/__tests__/ReactUpdates-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('ReactUpdates', () => {
ReactDOM = require('react-dom');
ReactDOMClient = require('react-dom/client');
ReactTestUtils = require('react-dom/test-utils');
act = require('internal-test-utils').act;
act = React.unstable_act;
Scheduler = require('scheduler');

const InternalTestUtils = require('internal-test-utils');
Expand Down
4 changes: 2 additions & 2 deletions packages/react-refresh/src/__tests__/ReactFresh-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe('ReactFresh', () => {
ReactDOM = require('react-dom');
ReactDOMClient = require('react-dom/client');
Scheduler = require('scheduler');
act = require('react-dom/test-utils').act;
act = React.unstable_act;
internalAct = require('internal-test-utils').act;

const InternalTestUtils = require('internal-test-utils');
Expand Down Expand Up @@ -3792,7 +3792,7 @@ describe('ReactFresh', () => {
React = require('react');
ReactDOM = require('react-dom');
Scheduler = require('scheduler');
act = require('react-dom/test-utils').act;
act = React.unstable_act;
internalAct = require('internal-test-utils').act;

// Important! Inject into the global hook *after* ReactDOM runs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('ReactFreshIntegration', () => {
ReactFreshRuntime = require('react-refresh/runtime');
ReactFreshRuntime.injectIntoGlobalHook(global);
ReactDOM = require('react-dom');
act = require('react-dom/test-utils').act;
act = React.unstable_act;
container = document.createElement('div');
document.body.appendChild(container);
exportsObj = undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe('ReactFlightDOMForm', () => {
ReactServerDOMClient = require('react-server-dom-webpack/client.edge');
ReactDOMServer = require('react-dom/server.edge');
ReactDOMClient = require('react-dom/client');
act = require('react-dom/test-utils').act;
act = React.unstable_act;
useFormState = require('react-dom').useFormState;
container = document.createElement('div');
document.body.appendChild(container);
Expand Down

0 comments on commit 8502b2d

Please sign in to comment.