Move mocking inside beforeEach for Transformer test

Reviewed By: rafeca

Differential Revision: D7040798

fbshipit-source-id: eece8c42e1368ead476c6d1495dad7e0abb4b0e3
This commit is contained in:
Miguel Jimenez Esun 2018-02-21 04:52:32 -08:00 committed by Facebook Github Bot
parent d110c7b9ea
commit 0f3f7daa4f
1 changed files with 5 additions and 6 deletions

View File

@ -9,11 +9,6 @@
*/ */
'use strict'; '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 Transformer = require('../');
const defaults = require('../../defaults'); const defaults = require('../../defaults');
@ -36,7 +31,11 @@ describe('Transformer', function() {
}; };
beforeEach(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 = jest.fn();
Cache.prototype.get = jest.fn((a, b, c) => c()); Cache.prototype.get = jest.fn((a, b, c) => c());