A Github actions reporter for node:test
npm install --save-dev @reporters/github
or
yarn add --dev @reporters/github
# .github/workflows/test.yml
- name: Run tests
run: node --test \
--test-reporter=@reporters/github --test-reporter-destination=stdout \
--test-reporter=spec --test-reporter-destination=stdout
when test failed, annotations will be added inside the github UI, with corresponding errors and diagnostics. see example run:
additionally, Annotations and summary will be added to the summary of the test run.
![Summary](https://private-user-images.githubusercontent.com/8221854/254799421-8934f5bb-3342-430c-9ae0-3c608a40c9f0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2NjE5NDksIm5iZiI6MTczOTY2MTY0OSwicGF0aCI6Ii84MjIxODU0LzI1NDc5OTQyMS04OTM0ZjViYi0zMzQyLTQzMGMtOWFlMC0zYzYwOGE0MGM5ZjAucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTVUMjMyMDQ5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MjBjNTQ5N2M5YjU4ZmU4OTNkZDhiNzgwZDczYWZiOWZlMjhkNzE4M2UwMzU3ZTliM2Y3YWI2ODQwYmRiOTEzYyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.i_j9QTIum22cR-nXLUNAtLLDYETJsC_nMrI9q2EKhfg)