Skip to content

Commit

Permalink
Replace jest.resetModuleRegistry() with jest.resetModules()
Browse files Browse the repository at this point in the history
Reviewed By: cpojer

Differential Revision: D4344961

fbshipit-source-id: 45453ec7ee3211743946ab9156f51430322b5832
  • Loading branch information
Alan Norbauer authored and facebook-github-bot committed Dec 19, 2016
1 parent 1052d29 commit 4aabf4b
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Libraries/BatchedBridge/__tests__/MessageQueue-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion Libraries/BatchedBridge/__tests__/NativeModules-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Image/__tests__/resolveAssetSource-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
4 changes: 2 additions & 2 deletions Libraries/Interaction/__tests__/InteractionManager-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('InteractionManager', () => {
let interactionComplete;

beforeEach(() => {
jest.resetModuleRegistry();
jest.resetModules();
InteractionManager = require('InteractionManager');

interactionStart = jest.fn();
Expand Down Expand Up @@ -163,7 +163,7 @@ describe('promise tasks', () => {
});
}
beforeEach(() => {
jest.resetModuleRegistry();
jest.resetModules();
InteractionManager = require('InteractionManager');
BatchedBridge = require('BatchedBridge');
sequenceId = 0;
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Interaction/__tests__/InteractionMixin-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('InteractionMixin', () => {
var component;

beforeEach(() => {
jest.resetModuleRegistry();
jest.resetModules();
InteractionManager = require('InteractionManager');
InteractionMixin = require('InteractionMixin');

Expand Down
2 changes: 1 addition & 1 deletion Libraries/Interaction/__tests__/TaskQueue-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe('TaskQueue', () => {
});
}
beforeEach(() => {
jest.resetModuleRegistry();
jest.resetModules();
onMoreTasks = jest.fn();
const TaskQueue = require('TaskQueue');
taskQueue = new TaskQueue({onMoreTasks});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('Object (ES7)', () => {
beforeEach(() => {
delete Object.entries;
delete Object.values;
jest.resetModuleRegistry();
jest.resetModules();
require('../Object.es7');
});

Expand Down

0 comments on commit 4aabf4b

Please sign in to comment.