jest-reporter-template
A template for creating custom Jest reporters using Typescript.
:rocket: Quickstart
- Clone
git clone https://github.com/ryparker/jest-reporter-template.git my-custom-reporter && cd my-custom-reporter
- Install dependencies
yarn install
- Transpile to JS
yarn build
:wrench: Using the reporter
To use the reporter you will will need to add the reporter's path to the reporters
option in your jest.config.js
.
Note: Jest config does not automagically transpile Typescript reporters yet. Although there is an open feature request that you can follow.
{
"reporters": ["<rootDir>/my-custom-reporter.js"]
}
See the official Jest docs for more details.
:spiral_notepad: Gist
If you'd rather not use this repository here is a Gist with the main interface for creating a Jest reporter.
Gist of Jest-Reporter-Interface