From 377d076c1148bb2ab218a7200a5f9dfd7a4dc723 Mon Sep 17 00:00:00 2001 From: eps1lon Date: Thu, 27 May 2021 11:08:50 +0200 Subject: [PATCH] jest.resetModuleRegistry -> jest.resetModules --- .../src/__tests__/ReactDOMServerIntegrationAttributes-test.js | 2 +- .../src/__tests__/ReactDOMServerIntegrationBasic-test.js | 2 +- .../src/__tests__/ReactDOMServerIntegrationCheckbox-test.js | 2 +- .../ReactDOMServerIntegrationClassContextType-test.js | 2 +- .../src/__tests__/ReactDOMServerIntegrationElements-test.js | 2 +- .../src/__tests__/ReactDOMServerIntegrationFragment-test.js | 2 +- .../src/__tests__/ReactDOMServerIntegrationHooks-test.js | 2 +- .../src/__tests__/ReactDOMServerIntegrationInput-test.js | 2 +- .../__tests__/ReactDOMServerIntegrationLegacyContext-test.js | 2 +- ...DOMServerIntegrationLegacyContextDisabled-test.internal.js | 2 +- .../src/__tests__/ReactDOMServerIntegrationModes-test.js | 2 +- .../src/__tests__/ReactDOMServerIntegrationNewContext-test.js | 2 +- .../__tests__/ReactDOMServerIntegrationReconnecting-test.js | 2 +- .../src/__tests__/ReactDOMServerIntegrationRefs-test.js | 2 +- .../src/__tests__/ReactDOMServerIntegrationSelect-test.js | 2 +- .../__tests__/ReactDOMServerIntegrationSpecialTypes-test.js | 2 +- .../src/__tests__/ReactDOMServerIntegrationTextarea-test.js | 2 +- .../ReactDOMServerIntegrationUntrustedURL-test.internal.js | 4 ++-- .../ReactDOMServerIntegrationUserInteraction-test.js | 2 +- .../react-dom/src/__tests__/ReactDOMServerLifecycles-test.js | 2 +- .../__tests__/ReactDOMServerPartialHydration-test.internal.js | 2 +- .../ReactDOMServerSelectiveHydration-test.internal.js | 2 +- .../src/__tests__/ReactDOMServerSuspense-test.internal.js | 2 +- .../src/__tests__/ReactDOMserverIntegrationProgress-test.js | 2 +- .../react-dom/src/__tests__/ReactFunctionComponent-test.js | 2 +- .../src/__tests__/ReactServerRenderingBrowser-test.js | 2 +- .../src/__tests__/EventPluginRegistry-test.internal.js | 2 +- .../src/__tests__/ReactIncrementalUpdates-test.js | 2 +- 28 files changed, 29 insertions(+), 29 deletions(-) diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationAttributes-test.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationAttributes-test.js index c1c23e2185842..f321ec677d4ec 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationAttributes-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationAttributes-test.js @@ -18,7 +18,7 @@ let ReactDOMServer; function initModules() { // Reset warning cache. - jest.resetModuleRegistry(); + jest.resetModules(); React = require('react'); ReactDOM = require('react-dom'); ReactDOMServer = require('react-dom/server'); diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationBasic-test.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationBasic-test.js index 5baceb1ab7bea..b29a4fd1e4210 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationBasic-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationBasic-test.js @@ -20,7 +20,7 @@ let ReactTestUtils; function initModules() { // Reset warning cache. - jest.resetModuleRegistry(); + jest.resetModules(); React = require('react'); ReactDOM = require('react-dom'); ReactDOMServer = require('react-dom/server'); diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationCheckbox-test.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationCheckbox-test.js index 3280ed5e0626c..c3e084ddbf6f5 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationCheckbox-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationCheckbox-test.js @@ -20,7 +20,7 @@ let ReactTestUtils; function initModules() { // Reset warning cache. - jest.resetModuleRegistry(); + jest.resetModules(); React = require('react'); ReactDOM = require('react-dom'); ReactDOMServer = require('react-dom/server'); diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationClassContextType-test.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationClassContextType-test.js index 94ea39e778e2d..0f8c9e7f10367 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationClassContextType-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationClassContextType-test.js @@ -18,7 +18,7 @@ let ReactTestUtils; function initModules() { // Reset warning cache. - jest.resetModuleRegistry(); + jest.resetModules(); React = require('react'); ReactDOM = require('react-dom'); ReactDOMServer = require('react-dom/server'); diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationElements-test.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationElements-test.js index 859647b39c1ff..0af0b91753a35 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationElements-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationElements-test.js @@ -19,7 +19,7 @@ let ReactDOMServer; let ReactTestUtils; function initModules() { - jest.resetModuleRegistry(); + jest.resetModules(); React = require('react'); ReactDOM = require('react-dom'); ReactDOMServer = require('react-dom/server'); diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationFragment-test.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationFragment-test.js index b729176f413e0..14bd0211c9e7f 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationFragment-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationFragment-test.js @@ -18,7 +18,7 @@ let ReactTestUtils; function initModules() { // Reset warning cache. - jest.resetModuleRegistry(); + jest.resetModules(); React = require('react'); ReactDOM = require('react-dom'); ReactDOMServer = require('react-dom/server'); diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationHooks-test.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationHooks-test.js index cfd23f843c140..189a53eec0aa7 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationHooks-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationHooks-test.js @@ -37,7 +37,7 @@ let clearYields; function initModules() { // Reset warning cache. - jest.resetModuleRegistry(); + jest.resetModules(); React = require('react'); ReactDOM = require('react-dom'); diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationInput-test.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationInput-test.js index 9ca1c92d8d427..6bd249008fdfa 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationInput-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationInput-test.js @@ -20,7 +20,7 @@ let ReactTestUtils; function initModules() { // Reset warning cache. - jest.resetModuleRegistry(); + jest.resetModules(); React = require('react'); ReactDOM = require('react-dom'); ReactDOMServer = require('react-dom/server'); diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationLegacyContext-test.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationLegacyContext-test.js index 5bcfa7b77e726..b43daf1c15a1d 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationLegacyContext-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationLegacyContext-test.js @@ -19,7 +19,7 @@ let ReactTestUtils; function initModules() { // Reset warning cache. - jest.resetModuleRegistry(); + jest.resetModules(); PropTypes = require('prop-types'); React = require('react'); ReactDOM = require('react-dom'); diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationLegacyContextDisabled-test.internal.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationLegacyContextDisabled-test.internal.js index 2b364dea1b703..80e3fa6c2e677 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationLegacyContextDisabled-test.internal.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationLegacyContextDisabled-test.internal.js @@ -19,7 +19,7 @@ let ReactTestUtils; function initModules() { // Reset warning cache. - jest.resetModuleRegistry(); + jest.resetModules(); React = require('react'); ReactDOM = require('react-dom'); ReactDOMServer = require('react-dom/server'); diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationModes-test.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationModes-test.js index 1a387fc7cb031..5a36d917429f9 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationModes-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationModes-test.js @@ -18,7 +18,7 @@ let ReactTestUtils; function initModules() { // Reset warning cache. - jest.resetModuleRegistry(); + jest.resetModules(); React = require('react'); ReactDOM = require('react-dom'); ReactDOMServer = require('react-dom/server'); diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationNewContext-test.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationNewContext-test.js index 85c214067531b..9317ad729a8a7 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationNewContext-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationNewContext-test.js @@ -18,7 +18,7 @@ let ReactTestUtils; function initModules() { // Reset warning cache. - jest.resetModuleRegistry(); + jest.resetModules(); React = require('react'); ReactDOM = require('react-dom'); ReactDOMServer = require('react-dom/server'); diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationReconnecting-test.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationReconnecting-test.js index aba74c2f34fcf..9a919e429258b 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationReconnecting-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationReconnecting-test.js @@ -18,7 +18,7 @@ let ReactTestUtils; function initModules() { // Reset warning cache. - jest.resetModuleRegistry(); + jest.resetModules(); React = require('react'); ReactDOM = require('react-dom'); diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationRefs-test.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationRefs-test.js index 4d39fce80c885..9b553585fb753 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationRefs-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationRefs-test.js @@ -18,7 +18,7 @@ let ReactTestUtils; function initModules() { // Reset warning cache. - jest.resetModuleRegistry(); + jest.resetModules(); React = require('react'); ReactDOM = require('react-dom'); ReactDOMServer = require('react-dom/server'); diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationSelect-test.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationSelect-test.js index 1ad9b0bb64540..cbdfa17d2aac7 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationSelect-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationSelect-test.js @@ -18,7 +18,7 @@ let ReactTestUtils; function initModules() { // Reset warning cache. - jest.resetModuleRegistry(); + jest.resetModules(); React = require('react'); ReactDOM = require('react-dom'); ReactDOMServer = require('react-dom/server'); diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationSpecialTypes-test.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationSpecialTypes-test.js index d5d632c987f4f..1c8af62e7a9e6 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationSpecialTypes-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationSpecialTypes-test.js @@ -23,7 +23,7 @@ let clearYields; function initModules() { // Reset warning cache. - jest.resetModuleRegistry(); + jest.resetModules(); React = require('react'); ReactDOM = require('react-dom'); ReactDOMServer = require('react-dom/server'); diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationTextarea-test.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationTextarea-test.js index 261b6c041495a..23a11302beda0 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationTextarea-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationTextarea-test.js @@ -18,7 +18,7 @@ let ReactTestUtils; function initModules() { // Reset warning cache. - jest.resetModuleRegistry(); + jest.resetModules(); React = require('react'); ReactDOM = require('react-dom'); ReactDOMServer = require('react-dom/server'); diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationUntrustedURL-test.internal.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationUntrustedURL-test.internal.js index 9fb48b3bce24c..67caf195562f1 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationUntrustedURL-test.internal.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationUntrustedURL-test.internal.js @@ -149,7 +149,7 @@ function runTests(itRenders, itRejectsRendering, expectToReject) { describe('ReactDOMServerIntegration - Untrusted URLs', () => { function initModules() { - jest.resetModuleRegistry(); + jest.resetModules(); React = require('react'); ReactDOM = require('react-dom'); ReactDOMServer = require('react-dom/server'); @@ -181,7 +181,7 @@ describe('ReactDOMServerIntegration - Untrusted URLs', () => { describe('ReactDOMServerIntegration - Untrusted URLs - disableJavaScriptURLs', () => { function initModules() { - jest.resetModuleRegistry(); + jest.resetModules(); const ReactFeatureFlags = require('shared/ReactFeatureFlags'); ReactFeatureFlags.disableJavaScriptURLs = true; diff --git a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationUserInteraction-test.js b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationUserInteraction-test.js index cc1c0f9613bfd..f058159bd6356 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerIntegrationUserInteraction-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerIntegrationUserInteraction-test.js @@ -18,7 +18,7 @@ let ReactTestUtils; function initModules() { // Reset warning cache. - jest.resetModuleRegistry(); + jest.resetModules(); React = require('react'); ReactDOM = require('react-dom'); ReactDOMServer = require('react-dom/server'); diff --git a/packages/react-dom/src/__tests__/ReactDOMServerLifecycles-test.js b/packages/react-dom/src/__tests__/ReactDOMServerLifecycles-test.js index 786eaac4f4483..6c56a10829ebb 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerLifecycles-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerLifecycles-test.js @@ -16,7 +16,7 @@ let ReactDOMServer; function initModules() { // Reset warning cache. - jest.resetModuleRegistry(); + jest.resetModules(); React = require('react'); ReactDOMServer = require('react-dom/server'); diff --git a/packages/react-dom/src/__tests__/ReactDOMServerPartialHydration-test.internal.js b/packages/react-dom/src/__tests__/ReactDOMServerPartialHydration-test.internal.js index a78298878b373..c39e8fbb5ef6b 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerPartialHydration-test.internal.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerPartialHydration-test.internal.js @@ -72,7 +72,7 @@ function dispatchMouseEvent(to, from) { describe('ReactDOMServerPartialHydration', () => { beforeEach(() => { - jest.resetModuleRegistry(); + jest.resetModules(); ReactFeatureFlags = require('shared/ReactFeatureFlags'); ReactFeatureFlags.enableSuspenseCallback = true; diff --git a/packages/react-dom/src/__tests__/ReactDOMServerSelectiveHydration-test.internal.js b/packages/react-dom/src/__tests__/ReactDOMServerSelectiveHydration-test.internal.js index 76d9b43d07f61..697dd40964edb 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerSelectiveHydration-test.internal.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerSelectiveHydration-test.internal.js @@ -110,7 +110,7 @@ function TODO_scheduleIdleDOMSchedulerTask(fn) { describe('ReactDOMServerSelectiveHydration', () => { beforeEach(() => { - jest.resetModuleRegistry(); + jest.resetModules(); const ReactFeatureFlags = require('shared/ReactFeatureFlags'); ReactFeatureFlags.enableCreateEventHandleAPI = true; diff --git a/packages/react-dom/src/__tests__/ReactDOMServerSuspense-test.internal.js b/packages/react-dom/src/__tests__/ReactDOMServerSuspense-test.internal.js index 60ab2edbdcf2b..3ecca8239cd64 100644 --- a/packages/react-dom/src/__tests__/ReactDOMServerSuspense-test.internal.js +++ b/packages/react-dom/src/__tests__/ReactDOMServerSuspense-test.internal.js @@ -19,7 +19,7 @@ let act; function initModules() { // Reset warning cache. - jest.resetModuleRegistry(); + jest.resetModules(); React = require('react'); ReactDOM = require('react-dom'); diff --git a/packages/react-dom/src/__tests__/ReactDOMserverIntegrationProgress-test.js b/packages/react-dom/src/__tests__/ReactDOMserverIntegrationProgress-test.js index 5ff530b10a858..e4b165836cc37 100644 --- a/packages/react-dom/src/__tests__/ReactDOMserverIntegrationProgress-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMserverIntegrationProgress-test.js @@ -18,7 +18,7 @@ let ReactTestUtils; function initModules() { // Reset warning cache. - jest.resetModuleRegistry(); + jest.resetModules(); React = require('react'); ReactDOM = require('react-dom'); ReactDOMServer = require('react-dom/server'); diff --git a/packages/react-dom/src/__tests__/ReactFunctionComponent-test.js b/packages/react-dom/src/__tests__/ReactFunctionComponent-test.js index 0aa9aa69285fa..b06964ad1ced9 100644 --- a/packages/react-dom/src/__tests__/ReactFunctionComponent-test.js +++ b/packages/react-dom/src/__tests__/ReactFunctionComponent-test.js @@ -20,7 +20,7 @@ function FunctionComponent(props) { describe('ReactFunctionComponent', () => { beforeEach(() => { - jest.resetModuleRegistry(); + jest.resetModules(); PropTypes = require('prop-types'); React = require('react'); ReactDOM = require('react-dom'); diff --git a/packages/react-dom/src/__tests__/ReactServerRenderingBrowser-test.js b/packages/react-dom/src/__tests__/ReactServerRenderingBrowser-test.js index 6356c054aedb9..f4a5cc9cafb22 100644 --- a/packages/react-dom/src/__tests__/ReactServerRenderingBrowser-test.js +++ b/packages/react-dom/src/__tests__/ReactServerRenderingBrowser-test.js @@ -20,7 +20,7 @@ describe('ReactServerRenderingBrowser', () => { React = require('react'); ReactDOMServer = require('react-dom/server'); // For extra isolation between what would be two bundles on npm - jest.resetModuleRegistry(); + jest.resetModules(); ReactDOMServerBrowser = require('react-dom/server.browser'); }); diff --git a/packages/react-native-renderer/src/__tests__/EventPluginRegistry-test.internal.js b/packages/react-native-renderer/src/__tests__/EventPluginRegistry-test.internal.js index c4c8b226a59bc..9fdffd37f48e5 100644 --- a/packages/react-native-renderer/src/__tests__/EventPluginRegistry-test.internal.js +++ b/packages/react-native-renderer/src/__tests__/EventPluginRegistry-test.internal.js @@ -14,7 +14,7 @@ describe('EventPluginRegistry', () => { let createPlugin; beforeEach(() => { - jest.resetModuleRegistry(); + jest.resetModules(); // These tests are intentionally testing the private injection interface. // The public API surface of this is covered by other tests so // if `EventPluginRegistry` is ever deleted, these tests should be diff --git a/packages/react-reconciler/src/__tests__/ReactIncrementalUpdates-test.js b/packages/react-reconciler/src/__tests__/ReactIncrementalUpdates-test.js index 200d6453010bd..cc2b1bd5aa6ca 100644 --- a/packages/react-reconciler/src/__tests__/ReactIncrementalUpdates-test.js +++ b/packages/react-reconciler/src/__tests__/ReactIncrementalUpdates-test.js @@ -18,7 +18,7 @@ let act; describe('ReactIncrementalUpdates', () => { beforeEach(() => { - jest.resetModuleRegistry(); + jest.resetModules(); React = require('react'); ReactNoop = require('react-noop-renderer');