Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Neizan93/jest-slow-test-highlighter
A Jest reporter that highlights and ranks the slowest tests in your suite, enabling performance improvements and optimized test run times.
https://github.com/Neizan93/jest-slow-test-highlighter
Last synced: 26 days ago
JSON representation
A Jest reporter that highlights and ranks the slowest tests in your suite, enabling performance improvements and optimized test run times.
- Host: GitHub
- URL: https://github.com/Neizan93/jest-slow-test-highlighter
- Owner: Neizan93
- License: mit
- Created: 2023-08-06T15:32:56.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-06T15:37:47.000Z (over 1 year ago)
- Last Synced: 2024-10-13T13:13:06.549Z (2 months ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-jest - jest-slow-test-highlighter
README
# jest-slow-test-highlighter
A custom Jest reporter that identifies and reports on the slowest running tests in your test suite.
## Installation
Install the package using npm:
```bash
npm install jest-slow-test-highlighter --save-dev
```## Usage
In your Jest configuration file (e.g., `jest.config.js`), add `jest-slow-test-highlighter` to your list of reporters:
```javascript
module.exports = {
// ... other Jest configuration options
reporters: ["default", "jest-slow-test-highlighter"]
};
```## Configuration Options
You can customize the behavior of the reporter by providing configuration options:
```javascript
module.exports = {
// ... other Jest configuration options
reporters: [
"default",
["jest-slow-test-highlighter", {
maxTests: 10, // Maximum number of slow tests to display. Default is 10.
slowSeconds: 5 // Threshold in seconds to consider a test as "slow". Default is 5 seconds.
}]
]
};
```### Options
* **maxTests**: Determines the maximum number of slow tests to display in the report. Default value is 10.
* **slowSeconds**: The threshold in seconds to classify a test as "slow". Any test that runs longer than this threshold will be considered slow and will be reported. Default value is 5 seconds.
## License
[MIT](./LICENSE)