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.
describe('MessageQueue', function() {
beforeEach(function() {
jest.resetModuleRegistry();
jest.resetModules();
MessageQueue = require('MessageQueue');
MessageQueueTestModule = require('MessageQueueTestModule');
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.
describe('MessageQueue', function() {
beforeEach(function() {
jest.resetModuleRegistry();
jest.resetModules();
global.__fbBatchedBridgeConfig = require('MessageQueueTestConfig');
BatchedBridge = require('BatchedBridge');

View File

@ -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', () => {

View File

@ -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;

View File

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

View File

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

View File

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