Skip to content

Commit 15dc38b

Browse files
Do not console log wrangler output during normal fixture tests
This creates a lot of unwanted logging in the console. The logging is still dumped to the console if the test times out, or if `WRANGLER_LOG=debug` is set as env var.
1 parent 62c1605 commit 15dc38b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

fixtures/shared/src/run-wrangler-long-lived.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,15 @@ async function runLongLivedWrangler(
9292

9393
const chunks: Buffer[] = [];
9494
wranglerProcess.stdout?.on("data", (chunk) => {
95-
console.log(`[${command}]`, chunk.toString());
95+
if (process.env.WRANGLER_LOG === "debug") {
96+
console.log(`[${command}]`, chunk.toString());
97+
}
9698
chunks.push(chunk);
9799
});
98100
wranglerProcess.stderr?.on("data", (chunk) => {
99-
console.log(`[${command}]`, chunk.toString());
101+
if (process.env.WRANGLER_LOG === "debug") {
102+
console.log(`[${command}]`, chunk.toString());
103+
}
100104
chunks.push(chunk);
101105
});
102106
const getOutput = () => Buffer.concat(chunks).toString();

0 commit comments

Comments
 (0)