vitest-tiny-reporter
v1.3.1
Published
Tiny reporter for vitest
Readme
vitest-tiny-reporter
vitest-tiny-reporter is a minimal reporter for Vitest that provides the most essential information about the test run. This is very useful with tools like lefthook that run several checks in parallel, where you want to see the test results without scrolling through a lot of output.
Installation
npm install --save vitest-tiny-reporterUsage
You can specify the reporter in your vitest.config.ts:
import type { UserConfig } from 'vitest/config';
import TinyReporter from 'vite-tiny-reporter';
export default {
test: {
reporters: [new TinyReporter()],
},
} satisfies UserConfig;Or you can use the reporter from the command line:
vitest --reporter vitest-tiny-reporterOr with lefthook:
pre-commit:
parallel: true
commands:
test:
glob: "*.ts"
run: npx vitest related --reporter=vitest-tiny-reporter --run {staged_files}
fail_text: "Tests failed"
env:
TERM: dumbOutput
Shell
In a shell, the output will look like this:
$ vitest
✖ FAIL 1 test failed
Test Files 1 failed (1)
Tests 1 failed | 10 passed (11)VSCode
When used with lefthook and committing in the VSCode UI, vitest-tiny-reporter shows actual usefull information.
Default reporter:
Tiny reporter:
