Replace jest.resetModuleRegistry() with jest.resetModules()
Reviewed By: cpojer Differential Revision: D4344961 fbshipit-source-id: 45453ec7ee3211743946ab9156f51430322b5832
This commit is contained in:
parent
1052d29fac
commit
4aabf4b6b3
|
@ -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();
|
||||||
|
|
|
@ -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');
|
||||||
|
|
|
@ -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', () => {
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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');
|
||||||
|
|
||||||
|
|
|
@ -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});
|
||||||
|
|
|
@ -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');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue