mirror of https://github.com/status-im/metro.git
Make sure that write streams are closed
Reviewed By: jeanlauliac Differential Revision: D4117716 fbshipit-source-id: c12f07c6a0e016ac14543878491a8b4160099e21
This commit is contained in:
parent
1ac86b2304
commit
b184c45275
|
@ -265,12 +265,15 @@ fs.createWriteStream.mockImpl(file => {
|
||||||
});
|
});
|
||||||
writeStream.__file = file;
|
writeStream.__file = file;
|
||||||
writeStream.__chunks = [];
|
writeStream.__chunks = [];
|
||||||
|
writeStream.end = jest.fn(writeStream.end);
|
||||||
|
fs.createWriteStream.mock.returned.push(writeStream);
|
||||||
return writeStream;
|
return writeStream;
|
||||||
} else {
|
} else {
|
||||||
throw new Error('Cannot open file ' + file);
|
throw new Error('Cannot open file ' + file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
fs.createWriteStream.mock.returned = [];
|
||||||
|
|
||||||
|
|
||||||
fs.__setMockFilesystem = (object) => (filesystem = object);
|
fs.__setMockFilesystem = (object) => (filesystem = object);
|
||||||
|
|
Loading…
Reference in New Issue