From 90fca83f1694a9c49e6bac2987f04ab84fcd469a Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Sun, 18 Feb 2024 22:40:27 +0100 Subject: [PATCH] Remove unused ReactTestUtils from ReactDOMServerIntegration tests --- .../__tests__/ReactDOMServerIntegrationAttributes-test.js | 3 --- .../src/__tests__/ReactDOMServerIntegrationBasic-test.js | 3 --- .../src/__tests__/ReactDOMServerIntegrationCheckbox-test.js | 3 --- .../ReactDOMServerIntegrationClassContextType-test.js | 3 --- .../src/__tests__/ReactDOMServerIntegrationElements-test.js | 3 --- .../src/__tests__/ReactDOMServerIntegrationFragment-test.js | 3 --- .../src/__tests__/ReactDOMServerIntegrationHooks-test.js | 3 --- .../src/__tests__/ReactDOMServerIntegrationInput-test.js | 3 --- .../__tests__/ReactDOMServerIntegrationLegacyContext-test.js | 3 --- ...OMServerIntegrationLegacyContextDisabled-test.internal.js | 3 --- .../src/__tests__/ReactDOMServerIntegrationModes-test.js | 3 --- .../__tests__/ReactDOMServerIntegrationNewContext-test.js | 3 --- .../__tests__/ReactDOMServerIntegrationReconnecting-test.js | 5 ----- .../src/__tests__/ReactDOMServerIntegrationRefs-test.js | 3 --- .../src/__tests__/ReactDOMServerIntegrationSelect-test.js | 3 --- .../__tests__/ReactDOMServerIntegrationSpecialTypes-test.js | 3 --- .../src/__tests__/ReactDOMServerIntegrationTextarea-test.js | 3 --- .../__tests__/ReactDOMServerIntegrationUntrustedURL-test.js | 5 ----- .../ReactDOMServerIntegrationUserInteraction-test.js | 3 --- .../src/__tests__/ReactDOMserverIntegrationProgress-test.js | 3 --- 20 files changed, 64 deletions(-) diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationAttributes-test.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationAttributes-test.js index bda021b5e06a7..0880f2c6b0557 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationAttributes-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationAttributes-test.js @@ -16,7 +16,6 @@ const ReactFeatureFlags = require('shared/ReactFeatureFlags'); let React; let ReactDOM; let ReactDOMClient; -let ReactTestUtils; let ReactDOMServer; function initModules() { @@ -26,13 +25,11 @@ function initModules() { ReactDOM = require('react-dom'); ReactDOMClient = require('react-dom/client'); ReactDOMServer = require('react-dom/server'); - ReactTestUtils = require('react-dom/test-utils'); // Make them available to the helpers. return { ReactDOMClient, ReactDOMServer, - ReactTestUtils, }; } diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationBasic-test.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationBasic-test.js index 2821dd088bb48..5589e5dc3a220 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationBasic-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationBasic-test.js @@ -17,7 +17,6 @@ const TEXT_NODE_TYPE = 3; let React; let ReactDOMClient; let ReactDOMServer; -let ReactTestUtils; function initModules() { // Reset warning cache. @@ -25,13 +24,11 @@ function initModules() { React = require('react'); ReactDOMClient = require('react-dom/client'); ReactDOMServer = require('react-dom/server'); - ReactTestUtils = require('react-dom/test-utils'); // Make them available to the helpers. return { ReactDOMClient, ReactDOMServer, - ReactTestUtils, }; } diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationCheckbox-test.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationCheckbox-test.js index 178ed7982a44f..cda89b825e503 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationCheckbox-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationCheckbox-test.js @@ -17,7 +17,6 @@ const {disableInputAttributeSyncing} = require('shared/ReactFeatureFlags'); let React; let ReactDOMClient; let ReactDOMServer; -let ReactTestUtils; function initModules() { // Reset warning cache. @@ -25,13 +24,11 @@ function initModules() { React = require('react'); ReactDOMClient = require('react-dom/client'); ReactDOMServer = require('react-dom/server'); - ReactTestUtils = require('react-dom/test-utils'); // Make them available to the helpers. return { ReactDOMClient, ReactDOMServer, - ReactTestUtils, }; } diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationClassContextType-test.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationClassContextType-test.js index 2df2d66b9b9fa..d39210e8d9f4d 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationClassContextType-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationClassContextType-test.js @@ -15,7 +15,6 @@ const ReactDOMServerIntegrationUtils = require('./utils/ReactDOMServerIntegratio let React; let ReactDOMClient; let ReactDOMServer; -let ReactTestUtils; function initModules() { // Reset warning cache. @@ -23,13 +22,11 @@ function initModules() { React = require('react'); ReactDOMClient = require('react-dom/client'); ReactDOMServer = require('react-dom/server'); - ReactTestUtils = require('react-dom/test-utils'); // Make them available to the helpers. return { ReactDOMClient, ReactDOMServer, - ReactTestUtils, }; } diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationElements-test.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationElements-test.js index ea30b45e3d61c..d7dc81d2d4ef8 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationElements-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationElements-test.js @@ -19,7 +19,6 @@ let ReactDOM; let ReactDOMClient; let ReactDOMServer; let ReactFeatureFlags; -let ReactTestUtils; function initModules() { jest.resetModules(); @@ -28,13 +27,11 @@ function initModules() { ReactDOMClient = require('react-dom/client'); ReactDOMServer = require('react-dom/server'); ReactFeatureFlags = require('shared/ReactFeatureFlags'); - ReactTestUtils = require('react-dom/test-utils'); // Make them available to the helpers. return { ReactDOMClient, ReactDOMServer, - ReactTestUtils, }; } diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationFragment-test.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationFragment-test.js index 8e8fc2aa8fe27..992e17755f766 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationFragment-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationFragment-test.js @@ -15,7 +15,6 @@ const ReactDOMServerIntegrationUtils = require('./utils/ReactDOMServerIntegratio let React; let ReactDOMClient; let ReactDOMServer; -let ReactTestUtils; function initModules() { // Reset warning cache. @@ -23,13 +22,11 @@ function initModules() { React = require('react'); ReactDOMClient = require('react-dom/client'); ReactDOMServer = require('react-dom/server'); - ReactTestUtils = require('react-dom/test-utils'); // Make them available to the helpers. return { ReactDOMClient, ReactDOMServer, - ReactTestUtils, }; } diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationHooks-test.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationHooks-test.js index 7e46bea5f93d9..22bd1df999c9d 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationHooks-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationHooks-test.js @@ -17,7 +17,6 @@ const ReactDOMServerIntegrationUtils = require('./utils/ReactDOMServerIntegratio let React; let ReactDOMClient; let ReactDOMServer; -let ReactTestUtils; let useState; let useReducer; let useEffect; @@ -41,7 +40,6 @@ function initModules() { React = require('react'); ReactDOMClient = require('react-dom/client'); ReactDOMServer = require('react-dom/server'); - ReactTestUtils = require('react-dom/test-utils'); useState = React.useState; useReducer = React.useReducer; useEffect = React.useEffect; @@ -69,7 +67,6 @@ function initModules() { return { ReactDOMClient, ReactDOMServer, - ReactTestUtils, }; } diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationInput-test.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationInput-test.js index 54780dae52cdb..4abf637a53713 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationInput-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationInput-test.js @@ -17,7 +17,6 @@ const {disableInputAttributeSyncing} = require('shared/ReactFeatureFlags'); let React; let ReactDOMClient; let ReactDOMServer; -let ReactTestUtils; function initModules() { // Reset warning cache. @@ -25,13 +24,11 @@ function initModules() { React = require('react'); ReactDOMClient = require('react-dom/client'); ReactDOMServer = require('react-dom/server'); - ReactTestUtils = require('react-dom/test-utils'); // Make them available to the helpers. return { ReactDOMClient, ReactDOMServer, - ReactTestUtils, }; } diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationLegacyContext-test.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationLegacyContext-test.js index 1481fcd326bb0..cea9052f020b6 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationLegacyContext-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationLegacyContext-test.js @@ -16,7 +16,6 @@ let PropTypes; let React; let ReactDOM; let ReactDOMServer; -let ReactTestUtils; function initModules() { // Reset warning cache. @@ -25,13 +24,11 @@ function initModules() { React = require('react'); ReactDOM = require('react-dom'); ReactDOMServer = require('react-dom/server'); - ReactTestUtils = require('react-dom/test-utils'); // Make them available to the helpers. return { ReactDOM, ReactDOMServer, - ReactTestUtils, }; } diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationLegacyContextDisabled-test.internal.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationLegacyContextDisabled-test.internal.js index a0b4cb8428bae..f7ea2ec7415eb 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationLegacyContextDisabled-test.internal.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationLegacyContextDisabled-test.internal.js @@ -16,7 +16,6 @@ let React; let ReactDOM; let ReactFeatureFlags; let ReactDOMServer; -let ReactTestUtils; function initModules() { // Reset warning cache. @@ -24,7 +23,6 @@ function initModules() { React = require('react'); ReactDOM = require('react-dom'); ReactDOMServer = require('react-dom/server'); - ReactTestUtils = require('react-dom/test-utils'); ReactFeatureFlags = require('shared/ReactFeatureFlags'); ReactFeatureFlags.disableLegacyContext = true; @@ -33,7 +31,6 @@ function initModules() { return { ReactDOM, ReactDOMServer, - ReactTestUtils, }; } diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationModes-test.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationModes-test.js index 99cf33b821f17..9dbac22704d17 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationModes-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationModes-test.js @@ -15,7 +15,6 @@ const ReactDOMServerIntegrationUtils = require('./utils/ReactDOMServerIntegratio let React; let ReactDOMClient; let ReactDOMServer; -let ReactTestUtils; function initModules() { // Reset warning cache. @@ -23,13 +22,11 @@ function initModules() { React = require('react'); ReactDOMClient = require('react-dom/client'); ReactDOMServer = require('react-dom/server'); - ReactTestUtils = require('react-dom/test-utils'); // Make them available to the helpers. return { ReactDOMClient, ReactDOMServer, - ReactTestUtils, }; } diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationNewContext-test.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationNewContext-test.js index bd4797f9ef146..58af90bce30e9 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationNewContext-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationNewContext-test.js @@ -15,7 +15,6 @@ const ReactDOMServerIntegrationUtils = require('./utils/ReactDOMServerIntegratio let React; let ReactDOMClient; let ReactDOMServer; -let ReactTestUtils; function initModules() { // Reset warning cache. @@ -23,13 +22,11 @@ function initModules() { React = require('react'); ReactDOMClient = require('react-dom/client'); ReactDOMServer = require('react-dom/server'); - ReactTestUtils = require('react-dom/test-utils'); // Make them available to the helpers. return { ReactDOMClient, ReactDOMServer, - ReactTestUtils, }; } diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationReconnecting-test.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationReconnecting-test.js index 76612f510d7d2..1cbc61dfd0116 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationReconnecting-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationReconnecting-test.js @@ -15,7 +15,6 @@ let React; let ReactDOM; let ReactDOMClient; let ReactDOMServer; -let ReactTestUtils; describe('ReactDOMServerIntegration', () => { function initModules() { @@ -25,13 +24,11 @@ describe('ReactDOMServerIntegration', () => { React = require('react'); ReactDOMClient = require('react-dom/client'); ReactDOMServer = require('react-dom/server'); - ReactTestUtils = require('react-dom/test-utils'); // Make them available to the helpers. return { ReactDOMClient, ReactDOMServer, - ReactTestUtils, }; } @@ -465,13 +462,11 @@ describe('ReactDOMServerIntegration (legacy)', () => { React = require('react'); ReactDOM = require('react-dom'); ReactDOMServer = require('react-dom/server'); - ReactTestUtils = require('react-dom/test-utils'); // Make them available to the helpers. return { ReactDOM, ReactDOMServer, - ReactTestUtils, }; } diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationRefs-test.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationRefs-test.js index e5564d3d9348c..1bef0f6447881 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationRefs-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationRefs-test.js @@ -14,7 +14,6 @@ const ReactDOMServerIntegrationUtils = require('./utils/ReactDOMServerIntegratio let React; let ReactDOMClient; let ReactDOMServer; -let ReactTestUtils; function initModules() { // Reset warning cache. @@ -22,13 +21,11 @@ function initModules() { React = require('react'); ReactDOMClient = require('react-dom/client'); ReactDOMServer = require('react-dom/server'); - ReactTestUtils = require('react-dom/test-utils'); // Make them available to the helpers. return { ReactDOMClient, ReactDOMServer, - ReactTestUtils, }; } diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationSelect-test.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationSelect-test.js index 9e503be7520b2..8bf3c7c3d20da 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationSelect-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationSelect-test.js @@ -15,7 +15,6 @@ const ReactDOMServerIntegrationUtils = require('./utils/ReactDOMServerIntegratio let React; let ReactDOMClient; let ReactDOMServer; -let ReactTestUtils; function initModules() { // Reset warning cache. @@ -23,13 +22,11 @@ function initModules() { React = require('react'); ReactDOMClient = require('react-dom/client'); ReactDOMServer = require('react-dom/server'); - ReactTestUtils = require('react-dom/test-utils'); // Make them available to the helpers. return { ReactDOMClient, ReactDOMServer, - ReactTestUtils, }; } diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationSpecialTypes-test.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationSpecialTypes-test.js index 8ea1c9d53baee..d86fd2fe2c964 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationSpecialTypes-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationSpecialTypes-test.js @@ -15,7 +15,6 @@ const ReactDOMServerIntegrationUtils = require('./utils/ReactDOMServerIntegratio let React; let ReactDOMClient; let ReactDOMServer; -let ReactTestUtils; let forwardRef; let memo; let yieldedValues; @@ -28,7 +27,6 @@ function initModules() { React = require('react'); ReactDOMClient = require('react-dom/client'); ReactDOMServer = require('react-dom/server'); - ReactTestUtils = require('react-dom/test-utils'); forwardRef = React.forwardRef; memo = React.memo; @@ -46,7 +44,6 @@ function initModules() { return { ReactDOMClient, ReactDOMServer, - ReactTestUtils, }; } diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationTextarea-test.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationTextarea-test.js index dd19385e62c56..ff69355812d3c 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationTextarea-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationTextarea-test.js @@ -15,7 +15,6 @@ const ReactDOMServerIntegrationUtils = require('./utils/ReactDOMServerIntegratio let React; let ReactDOMClient; let ReactDOMServer; -let ReactTestUtils; function initModules() { // Reset warning cache. @@ -23,13 +22,11 @@ function initModules() { React = require('react'); ReactDOMClient = require('react-dom/client'); ReactDOMServer = require('react-dom/server'); - ReactTestUtils = require('react-dom/test-utils'); // Make them available to the helpers. return { ReactDOMClient, ReactDOMServer, - ReactTestUtils, }; } diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationUntrustedURL-test.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationUntrustedURL-test.js index 55336a2cb5636..808396610c48d 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationUntrustedURL-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationUntrustedURL-test.js @@ -17,7 +17,6 @@ const ReactDOMServerIntegrationUtils = require('./utils/ReactDOMServerIntegratio let React; let ReactDOMClient; let ReactDOMServer; -let ReactTestUtils; let act; const EXPECTED_SAFE_URL = @@ -36,14 +35,12 @@ describe('ReactDOMServerIntegration - Untrusted URLs', () => { React = require('react'); ReactDOMClient = require('react-dom/client'); ReactDOMServer = require('react-dom/server'); - ReactTestUtils = require('react-dom/test-utils'); act = require('internal-test-utils').act; // Make them available to the helpers. return { ReactDOMClient, ReactDOMServer, - ReactTestUtils, }; } @@ -204,14 +201,12 @@ describe('ReactDOMServerIntegration - Untrusted URLs - disableJavaScriptURLs', ( React = require('react'); ReactDOMClient = require('react-dom/client'); ReactDOMServer = require('react-dom/server'); - ReactTestUtils = require('react-dom/test-utils'); act = require('internal-test-utils').act; // Make them available to the helpers. return { ReactDOMClient, ReactDOMServer, - ReactTestUtils, }; } diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationUserInteraction-test.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationUserInteraction-test.js index bc5980f23dda2..8d06e2d8ea857 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationUserInteraction-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationUserInteraction-test.js @@ -14,7 +14,6 @@ const ReactDOMServerIntegrationUtils = require('./utils/ReactDOMServerIntegratio let React; let ReactDOMClient; let ReactDOMServer; -let ReactTestUtils; function initModules() { // Reset warning cache. @@ -22,13 +21,11 @@ function initModules() { React = require('react'); ReactDOMClient = require('react-dom/client'); ReactDOMServer = require('react-dom/server'); - ReactTestUtils = require('react-dom/test-utils'); // Make them available to the helpers. return { ReactDOMClient, ReactDOMServer, - ReactTestUtils, }; } diff --git a/packages/react-dom/src/__tests__/ReactDOMserverIntegrationProgress-test.js b/packages/react-dom/src/__tests__/ReactDOMserverIntegrationProgress-test.js index cf51eff4aced3..65957d29e98d0 100644 --- a/packages/react-dom/src/__tests__/ReactDOMserverIntegrationProgress-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMserverIntegrationProgress-test.js @@ -15,7 +15,6 @@ const ReactDOMServerIntegrationUtils = require('./utils/ReactDOMServerIntegratio let React; let ReactDOMClient; let ReactDOMServer; -let ReactTestUtils; function initModules() { // Reset warning cache. @@ -23,13 +22,11 @@ function initModules() { React = require('react'); ReactDOMClient = require('react-dom/client'); ReactDOMServer = require('react-dom/server'); - ReactTestUtils = require('react-dom/test-utils'); // Make them available to the helpers. return { ReactDOMClient, ReactDOMServer, - ReactTestUtils, }; }