test: sanitize Windows CI buffer output (#567) (thanks @erikpr1994)
This commit is contained in:
@@ -16,6 +16,12 @@ if (process.platform === "win32" && process.env.GITHUB_ACTIONS === "true") {
|
||||
if (typeof chunk === "string") {
|
||||
return originalStdoutWrite(sanitizeWindowsCIOutput(chunk), ...args);
|
||||
}
|
||||
if (Buffer.isBuffer(chunk)) {
|
||||
return originalStdoutWrite(
|
||||
sanitizeWindowsCIOutput(chunk.toString("utf-8")),
|
||||
...args,
|
||||
);
|
||||
}
|
||||
return originalStdoutWrite(chunk as never, ...args);
|
||||
}) as typeof process.stdout.write;
|
||||
|
||||
@@ -23,6 +29,12 @@ if (process.platform === "win32" && process.env.GITHUB_ACTIONS === "true") {
|
||||
if (typeof chunk === "string") {
|
||||
return originalStderrWrite(sanitizeWindowsCIOutput(chunk), ...args);
|
||||
}
|
||||
if (Buffer.isBuffer(chunk)) {
|
||||
return originalStderrWrite(
|
||||
sanitizeWindowsCIOutput(chunk.toString("utf-8")),
|
||||
...args,
|
||||
);
|
||||
}
|
||||
return originalStderrWrite(chunk as never, ...args);
|
||||
}) as typeof process.stderr.write;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user