DEFAULT_VITEST_REPORTERS
The reporters every repo on this toolchain prints through.
Pinned, because vitest’s fallback is not one reporter but two. An unset reporters resolves to isAgent ? 'minimal' : 'default', and std-env’s isAgent is true inside every AI coding session — it reads AI_AGENT plus a dozen tool-specific variables. MinimalReporter extends the default one with summary: false, silent: 'passed-only', and a printTestModule that returns early unless the module FAILED. So the SAME npm run test, on the SAME tree, prints a line per test file for a developer and not one for a session, and swallows a passing test’s console output in the second case only. Measured on this library’s own unit-tests:script-utils project (43 files, vitest 5.0.1, 2026-09-23): 46 per-file lines over a 58-line log pinned, 0 over a 13-line log unset.
A gate should not report differently depending on who runs it, and a console.log a developer adds to find something should not vanish because a session ran the suite. The cost of the pin is the ~45 lines above.
What this deliberately does NOT carry is a reporter naming the file a dead pool worker took with it, because vitest 5 already does that itself. emitUnexpectedExit is (code, signal) => … there, building its message from the exit code, the signal, the runner state and the files the worker held. Driven against real runs on 2026-09-23 in all four shapes: a worker SIGKILLed mid-file, one killed at import before collection, the same under minimal, and the realistic one — the dying file among 42 others in a parallel run — which reported 42 passed (43) AND named the file. Under vitest 4 none of that existed and the reader was left subtracting over file names the log did not contain, which is what a reconciling reporter was written for; on 5 it would be a module, a test file and a coverage burden for every consumer, carrying a claim that is no longer true.
Exported because a repo that assembles its vitest projects by hand instead of through defineObsidianPluginVitestConfig — this library’s own suite among them — needs the same pin, and restating it there is how the two drift apart.
Import:
import { DEFAULT_VITEST_REPORTERS } from 'obsidian-dev-utils/script-utils/test-runners/vitest-config';Signature:
const DEFAULT_VITEST_REPORTERS: readonly ObsidianPluginVitestReporter[]Type: readonly ObsidianPluginVitestReporter[]
Links to this page: