modernweb-dev / web

Guides, tools and libraries for modern web development.
https://modern-web.dev
MIT License
2.21k stars 281 forks source link

test-runner-core always emits ansi codes to clear progress bars, even if there aren't progress bars #2623

Open MSLaguana opened 8 months ago

MSLaguana commented 8 months ago

The @web/test-runner-core package includes the TestRunnerCli class, which always has a DynamicTerminal that it references that has no knowledge of the staticLogging configuration variable. The TestRunnerCli will do things like decide not to print progress, but the DynamicTerminal will always try to clear the console via https://github.com/modernweb-dev/web/blob/master/packages/test-runner-core/src/cli/terminal/DynamicTerminal.ts#L133

This means that in non-interactive scenarios like CI, the output will have ansi codes embedded in it with no way to disable it (without drastic measures like monkey patching process.stdout.write) that i can find.