Do not use Node 8.x specific Stream.final

Summary:
grabbou: "This has been recently added to Node 8.x. Since it makes our tests to fail, I decided to
do a workaround that works for all the versions."

Originally patched in `0.52-stable` by grabbou

Fixes Node 6 JavaScript tests.
Closes https://github.com/facebook/react-native/pull/17298

Differential Revision: D6616521

Pulled By: hramos

fbshipit-source-id: 7256450d824a60a14006af7a68191222b3a5041a
This commit is contained in:
Héctor Ramos 2017-12-20 16:44:13 -08:00 committed by Facebook Github Bot
parent a0ff8c7706
commit 4216cdef13

View File

@ -347,9 +347,6 @@ fs.createWriteStream.mockImplementation(filePath => {
const writeStream = new stream.Writable({
write(chunk, encoding, callback) {
this.__chunks.push(chunk);
callback();
},
final(callback) {
node[path.basename(filePath)] = this.__chunks.join('');
callback();
},