From 117713eda3582de69ead6fbbb742d8044a946918 Mon Sep 17 00:00:00 2001 From: Cooldude2606 <25043174+Cooldude2606@users.noreply.github.com> Date: Sun, 11 May 2025 01:08:28 +0100 Subject: [PATCH] Fix silent test for alt host --- test/integration/index.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/test/integration/index.js b/test/integration/index.js index 5d4ee86a..baaaa7a0 100644 --- a/test/integration/index.js +++ b/test/integration/index.js @@ -201,8 +201,15 @@ function getControl() { function spawn(name, cmd, waitFor) { // eslint-disable-next-line node/no-process-env const silent = process.env.SILENT_TEST; + const bootstrap = !controllerProcess || !hostProcess; + function log(...args) { + if (!silent || bootstrap) { + console.log(...args); + } + } + return new Promise((resolve, reject) => { - console.log(cmd); + log(cmd); let parts = cmd.split(" "); let process = child_process.spawn(parts[0], parts.slice(1), { cwd: path.join("temp", "test") }); let stdout = new LineSplitter({ readableObjectMode: true }); @@ -216,10 +223,10 @@ function spawn(name, cmd, waitFor) { } resolve(process); } - console.log(name, line); + log(name, line); }; let onDataErr = line => { - console.log(name, line.toString("utf8")); + log(name, line.toString("utf8")); }; stdout.on("data", onDataOut); stderr.on("data", onDataErr);