fix: use process.stderr.write instead of console.error for script logging (#11140)

Prevents Jest from intercepting the lifecycle hook script output and
displaying it with stack traces, which made normal output look like errors.
This commit is contained in:
Zoltan Kochan
2026-03-29 01:12:09 +01:00
committed by GitHub
parent d8be9706d9
commit 978062f143

View File

@@ -107,7 +107,7 @@ Please unset the scriptShell option, or configure it to a .exe instead.
wd: opts.pkgRoot,
})
} else if (!opts.silent) {
console.error(chalk.dim(`$ ${m.scripts[stage]}`))
process.stderr.write(chalk.dim(`$ ${m.scripts[stage]}`) + '\n')
}
const logLevel = (opts.stdio !== 'inherit' || opts.silent)
? 'silent'