@vitest-agent/reporter
v1.0.8
Published
Named VitestAgentReporterFactory implementations for the vitest-agent ecosystem.
Maintainers
Readme
@vitest-agent/reporter
Part of the vitest-agent ecosystem. Most users want @vitest-agent/plugin, which pulls this package in automatically. Install
@vitest-agent/reporterdirectly only if you are writing a custom reporter.
The default reporter package and the reference for custom-reporter authors. Ships DefaultVitestAgentReporter, owns the live React Ink mount lifecycle, and re-exports the reporter contract types and dispatch helpers — everything a custom factory needs in one import.
Features
DefaultVitestAgentReporter— the production defaultVitestAgentReporterFactorythe plugin wires automatically; classifies runs into one of 12 shape × outcome cells, owns the Ink live-mount lifecycle, and emits a GitHub Actions Step Summary in CI- Dispatch helpers —
buildDispatchInputs,resolveCellOptions,renderAgentStringForReport,renderHumanStringForReport - Contract re-exports —
VitestAgentReporterFactory,ReporterKit,ReporterRenderInput,RenderedOutput,VitestAgentReporter,ResolvedReporterConfigall re-exported from@vitest-agent/sdkso you only need one import - Worked example —
DefaultVitestAgentReportersource in this package is the canonical reference for theVitestAgentReporterFactorycontract
Install
npm install --save-dev @vitest-agent/reporter
# or
pnpm add -D @vitest-agent/reporter@vitest-agent/reporter arrives automatically as a dependency of @vitest-agent/plugin. Install it directly only when authoring a custom reporter.
Quick start
import type {
ReporterKit,
ReporterRenderInput,
RenderedOutput,
VitestAgentReporter,
VitestAgentReporterFactory,
} from "@vitest-agent/reporter";
const myReporter: VitestAgentReporterFactory = (kit: ReporterKit): VitestAgentReporter => ({
render(input: ReporterRenderInput): ReadonlyArray<RenderedOutput> {
const passed = input.reports.reduce((n, r) => n + r.summary.passed, 0);
return [{ target: "stdout", content: `${passed} passed\n` }];
},
});Pass the factory to the plugin:
import { AgentPlugin } from "@vitest-agent/plugin";
AgentPlugin({ reporter: myReporter });Documentation
Custom-reporter guide at vitest-agent.dev/reporter.
