jest-html-reporters is a Jest test results processor that generates an interactive HTML summary of test execution. Currently at version 3.1.7, it receives regular maintenance updates with frequent minor releases addressing bug fixes and adding new features like dark mode support and console log integration. Key differentiators include its ability to produce a standalone HTML file, offering features such as sorting, filtering by test status, displaying detailed failure messages, and custom branding options. Unlike simple console reporters, it provides a persistent, shareable artifact of test runs, making it valuable for continuous integration environments and team collaboration, facilitating quick overviews of test health and granular investigation into failures.
npm install jest-html-reportersVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to configure jest-html-reporters in a TypeScript Jest project, including custom options like dark theme, console log inclusion, and custom filenames. It also shows a simple test file with passing, failing, and skipped tests, along with console output. Note the use of `--verbose=false` to ensure console logs are captured.
Ensure your Jest command includes `--verbose=false` when `includeConsoleLog` is enabled in your reporter options. Example: `jest --verbose=false`.
Explicitly set `openReport: false` in your reporter options within `jest.config.json` for CI/production environments to prevent automatic browser opening.
Upgrade to `jest-html-reporters@3.1.4` or newer to ensure proper handling of circular objects in test results, which can prevent report generation failures.
Install the package as a development dependency: `npm install jest-html-reporters --save-dev` or `yarn add jest-html-reporters --dev`.
Check your `jest.config.json` for correct `publicPath` and `filename` settings. Also, verify `failureMessageOnly` is not set to `2` if you expect a report even when all tests pass, or ensure some tests are failing if it is.
Run Jest with the `--verbose=false` flag to allow the reporter to correctly capture console logs. For example: `jest --verbose=false`.
No dependency data recorded yet.