https://github.com/wopian/jest-reporter-github-annotations
https://github.com/wopian/jest-reporter-github-annotations
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/wopian/jest-reporter-github-annotations
- Owner: wopian
- License: mit
- Created: 2022-01-26T09:58:40.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2024-10-28T04:55:55.000Z (about 1 year ago)
- Last Synced: 2024-10-30T03:55:56.273Z (about 1 year ago)
- Language: JavaScript
- Size: 1.03 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Jest Reporter GitHub Annotations
Report Jest test failures directly on pull requests with GitHub annotations
> [!IMPORTANT]
> [Jest 28](https://jestjs.io/blog/2022/04/25/jest-28) now includes a native GitHub Actions reporter. It is recommended to switch to the official GitHub Actions reporter, but this repository and package won't go away.
>
> Check out the [Jest blog post](https://jestjs.io/blog/2022/04/25/jest-28#github-actions-reporter) on how to setup the official Github Actions reporter on your projects!
## Install
```
yarn install -D @wopian/jest-reporter-github-annotations
```
## Usage
This reporter only outputs failing test results in GitHub's annotation format, so you must include the default Jest reporter to get human readable test results in the terminal logs.
### CLI (preferred)
Add it to your Jest script used by your GitHub Actions workflow in `package.json`:
```json
{
"scripts": {
"test": "jest --reporters=default --reporters=@wopian/jest-reporter-github-annotations",
}
}
```
### Jest Configuration
Or add it to your Jest configuration in `jest.config.js`:
```js
export default {
reporters: [
'default',
'@wopian/jest-reporter-github-annotations',
],
}
```
Or `package.json`:
```json
{
"jest": {
"reporters": [
"default",
"@wopian/jest-reporter-github-annotations",
],
}
}
```