diff --git a/packages/metro/src/JSTransformer/__tests__/Transformer-test.js b/packages/metro/src/JSTransformer/__tests__/Transformer-test.js index 30898622..a848c424 100644 --- a/packages/metro/src/JSTransformer/__tests__/Transformer-test.js +++ b/packages/metro/src/JSTransformer/__tests__/Transformer-test.js @@ -9,11 +9,6 @@ */ 'use strict'; -jest - .mock('fs', () => ({writeFileSync: jest.fn()})) - .mock('temp', () => ({path: () => '/arbitrary/path'})) - .mock('jest-worker', () => ({__esModule: true, default: jest.fn()})); - const Transformer = require('../'); const defaults = require('../../defaults'); @@ -36,7 +31,11 @@ describe('Transformer', function() { }; beforeEach(function() { - jest.resetModules(); + jest + .resetModules() + .mock('fs', () => ({writeFileSync: jest.fn()})) + .mock('temp', () => ({path: () => '/arbitrary/path'})) + .mock('jest-worker', () => ({__esModule: true, default: jest.fn()})); Cache = jest.fn(); Cache.prototype.get = jest.fn((a, b, c) => c());