✨ Add --log-level flag to frontend test runner

Lets a caller pin `app.common.logging`'s level for the duration of a
test run via `--log-level <trace|debug|info|warn|error>`. The flag is
off by default, so when absent the runner doesn't touch logger state
and stdout looks exactly as before.

When passed, the runner calls `(l/setup! {:app level})` right before
dispatching to the test block, so production code exercised by tests
emits only at the requested level or higher.

  pnpm run test:quiet -- --focus frontend-tests.logic.groups-test \
                         --log-level warn

Composes with `--focus`; the two flags are independent.

Caveats worth knowing: top-level log calls fired at namespace load
time run before the runner parses CLI options and therefore slip past
this flag; direct `println` / `js/console.log` calls bypass the
logging system entirely and are unaffected.
This commit is contained in:
Michael Panchenko
2026-05-21 14:20:10 +02:00
committed by Alonso Torres
parent c29f32c7ae
commit e252bcf901
3 changed files with 20 additions and 5 deletions
+3
View File
@@ -292,6 +292,9 @@ pnpm run test -- --focus frontend-tests.logic.components-and-tokens
# To run a single frontend test
pnpm run test -- --focus frontend-tests.logic.components-and-tokens/change-token-in-main
# To quiet app-level logging during the run (trace|debug|info|warn|error)
pnpm run test -- --focus frontend-tests.logic.components-and-tokens --log-level warn
```
For non-interactive runs (CI, scripted invocations, agent loops), use the quiet