feat: add quiet test output mode#61
Conversation
Adds a `--quiet` flag (and `EXODUS_TEST_QUIET=1` env equivalent) that suppresses pass/skip lines and per-suite headers for passing suites, surfacing only failing suites plus the final summary. Works across the node:test reporter, CI `::group::` grouping, and the per-file bundle/ browser runner path. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
sparten11740
left a comment
There was a problem hiding this comment.
utACK - some non-blocking comments
| setEnv('EXODUS_TEST_PLATFORM', options.binary === 'shermes' ? 'hermes' : options.binary) // e.g. 'hermes', 'node' | ||
| setEnv('EXODUS_TEST_TIMEOUT', options.testTimeout) | ||
| setEnv('EXODUS_TEST_DEVTOOLS', options.devtools ? '1' : '') | ||
| process.env.EXODUS_TEST_QUIET = options.quiet ? '1' : '' // internal signal for the reporter |
There was a problem hiding this comment.
shouldn't this also be using setEnv to warn of conflicts in case the env var is already set?
There was a problem hiding this comment.
it currently it silently ignores the EXODUS_TEST_QUIET env var. I don't think we need to support two modes (env var and cli flag) for every single thing, or even most things, but let's wait to hear from @ChALkeR
There was a problem hiding this comment.
The point of setEnv is to not support the two modes (that has to be done in option defaults if needed), but to assert that user is not trying to pass conflicting values via env and opt.
Unless you switch this to setEnv, EXODUS_TEST_QUIET=1 ... without --quiet will silently override it with '', fail-open, and the usage error will be invisible to user, so they would wonder why doesn't the env var they passed work when nothing complains.
With setEnv, it will throw instead, which is the desired behavior here.
| if (!quiet) { | ||
| const label = data.skip ? color('⏭ SKIP ', dim) : color('✔ PASS ', 'green') | ||
| if (!pskip(path)) print(`${label}${pathstr(path)}${formatSuffix(data)}`) | ||
| } |
There was a problem hiding this comment.
I wonder if architecturally this could've been done in a more extensible way e.g. abstract this behind a reporter interface that receives the log output and internally decides whether to buffer, print right away, remove parts of the output, etc.
Summary
--quietflag that only reports failing test suites plus the final summaryVerification
npm run lintFORCE_COLOR=1 npm testNote: plain
npm testis color-sensitive in this shell because vendor matcher assertions expect colored output;FORCE_COLOR=1 npm testpasses.