mirror of https://github.com/status-im/metro.git
Move mocking inside beforeEach for Transformer test
Reviewed By: rafeca Differential Revision: D7040798 fbshipit-source-id: eece8c42e1368ead476c6d1495dad7e0abb4b0e3
This commit is contained in:
parent
d110c7b9ea
commit
0f3f7daa4f
|
@ -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());
|
||||||
|
|
Loading…
Reference in New Issue