mirror of
https://github.com/status-im/metro.git
synced 2025-01-20 07:59:12 +00:00
Fix flaky Transformer test
Reviewed By: rafeca Differential Revision: D7279027 fbshipit-source-id: 2e2be997259eae3fcb2b6a3a74ad22e1daa218d9
This commit is contained in:
parent
43ab7ab811
commit
7c4b7da523
@ -9,13 +9,13 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
const Transformer = require('../');
|
||||
const defaults = require('../../defaults');
|
||||
|
||||
const {Readable} = require('stream');
|
||||
|
||||
describe('Transformer', function() {
|
||||
let api;
|
||||
let Transformer;
|
||||
const fileName = '/an/arbitrary/file.js';
|
||||
const localPath = 'arbitrary/file.js';
|
||||
const transformModulePath = __filename;
|
||||
@ -39,11 +39,9 @@ describe('Transformer', function() {
|
||||
|
||||
const fs = require('fs');
|
||||
const jestWorker = require('jest-worker');
|
||||
|
||||
fs.writeFileSync.mockClear();
|
||||
|
||||
jestWorker.default.mockClear();
|
||||
jestWorker.default.mockImplementation((workerPath, opts) => {
|
||||
jestWorker.default.mockImplementation(function(workerPath, opts) {
|
||||
api = {
|
||||
end: jest.fn(),
|
||||
getStdout: () => new Readable({read() {}}),
|
||||
@ -64,6 +62,8 @@ describe('Transformer', function() {
|
||||
|
||||
return api;
|
||||
});
|
||||
|
||||
Transformer = require('../');
|
||||
});
|
||||
|
||||
it('passes transform data to the worker farm when transforming', async () => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user