Replace jest.resetModuleRegistry() with jest.resetModules()

Reviewed By: cpojer

Differential Revision: D4344961

fbshipit-source-id: 45453ec7ee3211743946ab9156f51430322b5832
This commit is contained in:
Alan Norbauer 2016-12-18 17:02:57 -08:00 committed by Facebook Github Bot
parent 1052d29fac
commit 4aabf4b6b3
7 changed files with 8 additions and 8 deletions

View File

@ -35,7 +35,7 @@ const assertQueue = (flushedQueue, index, moduleID, methodID, params) => {
// local callbacks stored by IDs are cleaned up. // local callbacks stored by IDs are cleaned up.
describe('MessageQueue', function() { describe('MessageQueue', function() {
beforeEach(function() { beforeEach(function() {
jest.resetModuleRegistry(); jest.resetModules();
MessageQueue = require('MessageQueue'); MessageQueue = require('MessageQueue');
MessageQueueTestModule = require('MessageQueueTestModule'); MessageQueueTestModule = require('MessageQueueTestModule');
queue = new MessageQueue(); queue = new MessageQueue();

View File

@ -40,7 +40,7 @@ const assertQueue = (flushedQueue, index, moduleID, methodID, params) => {
// [ ] Remote invocation throws if not supplying an error callback. // [ ] Remote invocation throws if not supplying an error callback.
describe('MessageQueue', function() { describe('MessageQueue', function() {
beforeEach(function() { beforeEach(function() {
jest.resetModuleRegistry(); jest.resetModules();
global.__fbBatchedBridgeConfig = require('MessageQueueTestConfig'); global.__fbBatchedBridgeConfig = require('MessageQueueTestConfig');
BatchedBridge = require('BatchedBridge'); BatchedBridge = require('BatchedBridge');

View File

@ -26,7 +26,7 @@ function expectResolvesAsset(input, expectedSource) {
describe('resolveAssetSource', () => { describe('resolveAssetSource', () => {
beforeEach(() => { beforeEach(() => {
jest.resetModuleRegistry(); jest.resetModules();
}); });
it('returns same source for simple static and network images', () => { it('returns same source for simple static and network images', () => {

View File

@ -25,7 +25,7 @@ describe('InteractionManager', () => {
let interactionComplete; let interactionComplete;
beforeEach(() => { beforeEach(() => {
jest.resetModuleRegistry(); jest.resetModules();
InteractionManager = require('InteractionManager'); InteractionManager = require('InteractionManager');
interactionStart = jest.fn(); interactionStart = jest.fn();
@ -163,7 +163,7 @@ describe('promise tasks', () => {
}); });
} }
beforeEach(() => { beforeEach(() => {
jest.resetModuleRegistry(); jest.resetModules();
InteractionManager = require('InteractionManager'); InteractionManager = require('InteractionManager');
BatchedBridge = require('BatchedBridge'); BatchedBridge = require('BatchedBridge');
sequenceId = 0; sequenceId = 0;

View File

@ -17,7 +17,7 @@ describe('InteractionMixin', () => {
var component; var component;
beforeEach(() => { beforeEach(() => {
jest.resetModuleRegistry(); jest.resetModules();
InteractionManager = require('InteractionManager'); InteractionManager = require('InteractionManager');
InteractionMixin = require('InteractionMixin'); InteractionMixin = require('InteractionMixin');

View File

@ -34,7 +34,7 @@ describe('TaskQueue', () => {
}); });
} }
beforeEach(() => { beforeEach(() => {
jest.resetModuleRegistry(); jest.resetModules();
onMoreTasks = jest.fn(); onMoreTasks = jest.fn();
const TaskQueue = require('TaskQueue'); const TaskQueue = require('TaskQueue');
taskQueue = new TaskQueue({onMoreTasks}); taskQueue = new TaskQueue({onMoreTasks});

View File

@ -19,7 +19,7 @@ describe('Object (ES7)', () => {
beforeEach(() => { beforeEach(() => {
delete Object.entries; delete Object.entries;
delete Object.values; delete Object.values;
jest.resetModuleRegistry(); jest.resetModules();
require('../Object.es7'); require('../Object.es7');
}); });