diff --git a/packages/react-dom/src/__tests__/ReactDOMServerSuspense-test.internal.js b/packages/react-dom/src/__tests__/ReactDOMServerSuspense-test.internal.js index 2a0e1f68a72b2..37da49cca16db 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerSuspense-test.internal.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerSuspense-test.internal.js @@ -9,44 +9,24 @@ 'use strict'; -const ReactDOMServerIntegrationUtils = require('./utils/ReactDOMServerIntegrationTestUtils'); - let React; -let ReactDOM; let ReactDOMClient; let ReactDOMServer; -let ReactTestUtils; let act; let SuspenseList; -function initModules() { - // Reset warning cache. - jest.resetModules(); - - React = require('react'); - ReactDOM = require('react-dom'); - ReactDOMClient = require('react-dom/client'); - ReactDOMServer = require('react-dom/server'); - ReactTestUtils = require('react-dom/test-utils'); - act = require('internal-test-utils').act; - if (gate(flags => flags.enableSuspenseList)) { - SuspenseList = React.unstable_SuspenseList; - } - - // Make them available to the helpers. - return { - ReactDOM, - ReactDOMServer, - ReactTestUtils, - }; -} - -const {itThrowsWhenRendering, resetModules, serverRender} = - ReactDOMServerIntegrationUtils(initModules); - describe('ReactDOMServerSuspense', () => { beforeEach(() => { - resetModules(); + // Reset warning cache. + jest.resetModules(); + + React = require('react'); + ReactDOMClient = require('react-dom/client'); + ReactDOMServer = require('react-dom/server'); + act = require('internal-test-utils').act; + if (gate(flags => flags.enableSuspenseList)) { + SuspenseList = React.unstable_SuspenseList; + } }); function Text(props) { @@ -97,42 +77,42 @@ describe('ReactDOMServerSuspense', () => { } it('should render the children when no promise is thrown', async () => { - const c = await serverRender( -