diff --git a/test/lib/processors/stringReplacer.js b/test/lib/processors/stringReplacer.js index 686b4f17e..155ff5888 100644 --- a/test/lib/processors/stringReplacer.js +++ b/test/lib/processors/stringReplacer.js @@ -26,7 +26,10 @@ test.serial("Replaces string pattern from resource stream", async (t) => { const resource = { getStream: () => { - return Readable.from([input]); + const stream = new Readable(); + stream.push(Buffer.from(input)); + stream.push(null); + return stream; }, setStream: (outputStream) => { output = getStringFromStream(outputStream); @@ -45,7 +48,10 @@ test.serial("Replaces string pattern from resource stream", async (t) => { t.deepEqual(await output, expected, "Correct file content should be set"); }); -test.serial("Correctly processes utf8 characters within separate chunks", async (t) => { +// Skip test in Node v8 as unicode handling of streams seems to be broken +test[ + process.version.startsWith("v8.") ? "skip" : "serial" +]("Correctly processes utf8 characters within separate chunks", async (t) => { const utf8string = "Κυ"; const expected = utf8string;