Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rickhanlonii/jest-silent-reporter
A silent reporter for Jest
https://github.com/rickhanlonii/jest-silent-reporter
javascript jest testing
Last synced: 2 days ago
JSON representation
A silent reporter for Jest
- Host: GitHub
- URL: https://github.com/rickhanlonii/jest-silent-reporter
- Owner: rickhanlonii
- License: mit
- Created: 2018-02-14T14:01:05.000Z (almost 7 years ago)
- Default Branch: main
- Last Pushed: 2024-05-22T14:10:46.000Z (8 months ago)
- Last Synced: 2025-01-11T06:44:20.666Z (3 days ago)
- Topics: javascript, jest, testing
- Language: JavaScript
- Size: 56.6 KB
- Stars: 147
- Watchers: 7
- Forks: 20
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-jest - jest-silent-reporter
README
Jest Silent Reporter
Custom reporter
for Jest that only prints failed tests.
## Installation
Using [npm](https://www.npmjs.com/):
```sh
$ npm i --save-dev jest-silent-reporter
```Using [yarn](https://yarnpkg.com/):
```sh
$ yarn add --dev jest-silent-reporter
```## Usage
Jest CLI:
```bash
jest --reporters=jest-silent-reporter
```Jest config:
```json
{
"reporters": ["jest-silent-reporter"]
}
```## Options
### useDots: boolean
For large test suites, `jest-silent-reporter` can cause CI to fail due to having
no output for some configured amount of time. Using the `useDots` option will
output dots for each test file, similar to a dot reporter.```json
{
"reporters": [["jest-silent-reporter", { "useDots": true }]]
}
```Note: this config is also available as an environment variable `JEST_SILENT_REPORTER_DOTS=true`.
### showWarnings: boolean
Warnings are supressed by default, use `showWarnings` to log them.
```json
{
"reporters": [["jest-silent-reporter", { "showWarnings": true }]]
}
```Note: this config is also available as an environment variable `JEST_SILENT_REPORTER_SHOW_WARNINGS=true`.
### showPaths: boolean
Sometimes it might come in handy to display the test suites' paths (i.e. when
running tests in a terminal inside IDE for quicker file navigation).```json
{
"reporters": [["jest-silent-reporter", { "showPaths": true }]]
}
```Note: this config is also available as an environment variable `JEST_SILENT_REPORTER_SHOW_PATHS=true`.
## Screenshots
#### All tests passed
![Screenshot: all tests passed](https://user-images.githubusercontent.com/2440089/188526258-3d352067-d0c4-4999-9e22-5613981c8887.png)
#### Tests failed
![Screenshot: some tests failed](https://user-images.githubusercontent.com/2440089/188526185-4b3e217c-0228-4e3d-930a-5e508e4770b3.png)
## Licence
MIT