Skip to content

Commit

Permalink
Fix/skip tests for Node 8
Browse files Browse the repository at this point in the history
  • Loading branch information
matz3 committed Feb 6, 2020
1 parent 00e8971 commit 773fb6a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/lib/processors/stringReplacer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;

Expand Down

0 comments on commit 773fb6a

Please sign in to comment.