@reporters/github
v2.0.1
Published
A github actions reporter for `node:test`
Maintainers
Readme
GitHub Actions Annotations Reporter
Adds GitHub Actions annotations (inline error annotations and diagnostics) and a job summary to node:test.
This reporter emits only GitHub Actions workflow commands — it produces no human-readable test log of its own, so you pair it with another reporter (e.g. spec) for the readable output. Outside GitHub Actions it emits nothing.
githubvsgh
@reporters/github(this package) — annotations and summary only. Layer it on top of whatever reporter you already use; it stays out of the way locally (no output unless running in GitHub Actions).@reporters/gh— all-in-one: bundles a readable spec-style log with the annotations and summary, so you only need a single--test-reporter.See the full comparison in the main README.
Installation
npm install --save-dev @reporters/githubor
yarn add --dev @reporters/githubUsage
# .github/workflows/test.yml
- name: Run tests
run: node --test \
--test-reporter=@reporters/github --test-reporter-destination=stdout \
--test-reporter=spec --test-reporter-destination=stdoutThe second reporter (spec here, but any reporter works) provides the human-readable log; @reporters/github adds the annotations and summary alongside it. If you'd rather not juggle two reporters, use @reporters/gh instead.
Result
when test failed, annotations will be added inside the github UI, with corresponding errors and diagnostics. see example run:
Inline annotations
additionally, Annotations and summary will be added to the summary of the test run.
