From 4aabf4b6b384a695f09e21239d1d13d5e329e1ef Mon Sep 17 00:00:00 2001 From: Alan Norbauer Date: Sun, 18 Dec 2016 17:02:57 -0800 Subject: [PATCH] Replace jest.resetModuleRegistry() with jest.resetModules() Reviewed By: cpojer Differential Revision: D4344961 fbshipit-source-id: 45453ec7ee3211743946ab9156f51430322b5832 --- Libraries/BatchedBridge/__tests__/MessageQueue-test.js | 2 +- Libraries/BatchedBridge/__tests__/NativeModules-test.js | 2 +- Libraries/Image/__tests__/resolveAssetSource-test.js | 2 +- Libraries/Interaction/__tests__/InteractionManager-test.js | 4 ++-- Libraries/Interaction/__tests__/InteractionMixin-test.js | 2 +- Libraries/Interaction/__tests__/TaskQueue-test.js | 2 +- .../src/Resolver/polyfills/__tests__/Object.es7-test.js | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Libraries/BatchedBridge/__tests__/MessageQueue-test.js b/Libraries/BatchedBridge/__tests__/MessageQueue-test.js index f4ac6f44feaa6d..c5f69840d1a7ac 100644 --- a/Libraries/BatchedBridge/__tests__/MessageQueue-test.js +++ b/Libraries/BatchedBridge/__tests__/MessageQueue-test.js @@ -35,7 +35,7 @@ const assertQueue = (flushedQueue, index, moduleID, methodID, params) => { // local callbacks stored by IDs are cleaned up. describe('MessageQueue', function() { beforeEach(function() { - jest.resetModuleRegistry(); + jest.resetModules(); MessageQueue = require('MessageQueue'); MessageQueueTestModule = require('MessageQueueTestModule'); queue = new MessageQueue(); diff --git a/Libraries/BatchedBridge/__tests__/NativeModules-test.js b/Libraries/BatchedBridge/__tests__/NativeModules-test.js index 10e9ac3a7b2419..fb095924329667 100644 --- a/Libraries/BatchedBridge/__tests__/NativeModules-test.js +++ b/Libraries/BatchedBridge/__tests__/NativeModules-test.js @@ -40,7 +40,7 @@ const assertQueue = (flushedQueue, index, moduleID, methodID, params) => { // [ ] Remote invocation throws if not supplying an error callback. describe('MessageQueue', function() { beforeEach(function() { - jest.resetModuleRegistry(); + jest.resetModules(); global.__fbBatchedBridgeConfig = require('MessageQueueTestConfig'); BatchedBridge = require('BatchedBridge'); diff --git a/Libraries/Image/__tests__/resolveAssetSource-test.js b/Libraries/Image/__tests__/resolveAssetSource-test.js index 03a953f92c2eb2..091cf832b86627 100644 --- a/Libraries/Image/__tests__/resolveAssetSource-test.js +++ b/Libraries/Image/__tests__/resolveAssetSource-test.js @@ -26,7 +26,7 @@ function expectResolvesAsset(input, expectedSource) { describe('resolveAssetSource', () => { beforeEach(() => { - jest.resetModuleRegistry(); + jest.resetModules(); }); it('returns same source for simple static and network images', () => { diff --git a/Libraries/Interaction/__tests__/InteractionManager-test.js b/Libraries/Interaction/__tests__/InteractionManager-test.js index d7663271868bc7..be967e45d3f4f5 100644 --- a/Libraries/Interaction/__tests__/InteractionManager-test.js +++ b/Libraries/Interaction/__tests__/InteractionManager-test.js @@ -25,7 +25,7 @@ describe('InteractionManager', () => { let interactionComplete; beforeEach(() => { - jest.resetModuleRegistry(); + jest.resetModules(); InteractionManager = require('InteractionManager'); interactionStart = jest.fn(); @@ -163,7 +163,7 @@ describe('promise tasks', () => { }); } beforeEach(() => { - jest.resetModuleRegistry(); + jest.resetModules(); InteractionManager = require('InteractionManager'); BatchedBridge = require('BatchedBridge'); sequenceId = 0; diff --git a/Libraries/Interaction/__tests__/InteractionMixin-test.js b/Libraries/Interaction/__tests__/InteractionMixin-test.js index 548f1bdf96a420..2e379e466bcc95 100644 --- a/Libraries/Interaction/__tests__/InteractionMixin-test.js +++ b/Libraries/Interaction/__tests__/InteractionMixin-test.js @@ -17,7 +17,7 @@ describe('InteractionMixin', () => { var component; beforeEach(() => { - jest.resetModuleRegistry(); + jest.resetModules(); InteractionManager = require('InteractionManager'); InteractionMixin = require('InteractionMixin'); diff --git a/Libraries/Interaction/__tests__/TaskQueue-test.js b/Libraries/Interaction/__tests__/TaskQueue-test.js index e1a24009f01e57..004e10e09240d0 100644 --- a/Libraries/Interaction/__tests__/TaskQueue-test.js +++ b/Libraries/Interaction/__tests__/TaskQueue-test.js @@ -34,7 +34,7 @@ describe('TaskQueue', () => { }); } beforeEach(() => { - jest.resetModuleRegistry(); + jest.resetModules(); onMoreTasks = jest.fn(); const TaskQueue = require('TaskQueue'); taskQueue = new TaskQueue({onMoreTasks}); diff --git a/packager/react-packager/src/Resolver/polyfills/__tests__/Object.es7-test.js b/packager/react-packager/src/Resolver/polyfills/__tests__/Object.es7-test.js index 016ab9e47a0812..9024d97f26906b 100644 --- a/packager/react-packager/src/Resolver/polyfills/__tests__/Object.es7-test.js +++ b/packager/react-packager/src/Resolver/polyfills/__tests__/Object.es7-test.js @@ -19,7 +19,7 @@ describe('Object (ES7)', () => { beforeEach(() => { delete Object.entries; delete Object.values; - jest.resetModuleRegistry(); + jest.resetModules(); require('../Object.es7'); });