From 51af4c5d38eb3285436053aebeab64558e3f59ee Mon Sep 17 00:00:00 2001 From: gavin913427-hash Date: Mon, 4 May 2026 23:07:58 +0800 Subject: [PATCH] fix: suppress npm progress output in tests for hermeticity (fixes #2004) --- .changeset/fix-test-hermeticity.md | 5 +++++ test/helpers/init.js | 7 +++++++ 2 files changed, 12 insertions(+) create mode 100644 .changeset/fix-test-hermeticity.md diff --git a/.changeset/fix-test-hermeticity.md b/.changeset/fix-test-hermeticity.md new file mode 100644 index 000000000..ceb9e92f6 --- /dev/null +++ b/.changeset/fix-test-hermeticity.md @@ -0,0 +1,5 @@ +--- +"@asyncapi/cli": patch +--- + +Suppress npm progress output during tests to prevent stdout pollution (fixes #2004) diff --git a/test/helpers/init.js b/test/helpers/init.js index c12136cca..cf696c71a 100644 --- a/test/helpers/init.js +++ b/test/helpers/init.js @@ -2,6 +2,13 @@ const path = require('path'); process.env.TS_NODE_PROJECT = path.resolve('test/tsconfig.json'); process.env.NODE_ENV = 'development'; +// Suppress npm progress output during tests to prevent stdout pollution +// (fixes #2004: integration tests fail when npm prints idealTree spinners) +process.env.npm_config_loglevel = 'silent'; +process.env.npm_config_progress = 'false'; +process.env.NPM_CONFIG_LOGLEVEL = 'silent'; +process.env.NPM_CONFIG_PROGRESS = 'false'; + global.oclif = global.oclif || {}; global.oclif.columns = 80;