npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

jest-html-reporter

v4.3.0

Published

Jest test results processor for generating a summary in HTML

Readme

Installation

npm:

$ npm install jest-html-reporter --save-dev

yarn:

$ yarn add jest-html-reporter --dev

Usage

Configure Jest to process the test results by adding the following entry to the Jest config (jest.config.json):

"reporters": [
	"default",
	["./node_modules/jest-html-reporter", {
		"pageTitle": "Test Report"
	}]
]

As you run Jest from within the terminal, a file called test-report.html will be created within your root folder containing information about your tests.

There are multiple configuration options available. Read more about these further down in this document.

Alternative Usage as a Test Results Processor

To run the reporter as a test results processor (after Jest is complete instead of running in parallel), add the following entry to the Jest config (jest.config.json):

{
	"testResultsProcessor": "./node_modules/jest-html-reporter"
}

Note: When running as a testResultsProcessor, the configuration needs either to be placed within a new file named jesthtmlreporter.config.json residing in the root folder

{
	"pageTitle": "Test Report",
}

or via adding a key to package.json named "jest-html-reporter":

{
	...
	"jest-html-reporter": {
		"pageTitle": "Test Report",
	}
}

📌 Configuration Options (All Optional)

| Option | Type | Default | Description | | ----------------------------------- | ------------------------------------------ | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | additionalInformation | Array<{ label: string; value: string; }> | null | A list of additional information to be added to the top of the report. | | append | boolean | false | Append test results to an existing report. | | boilerplate | string | null | Path to an HTML boilerplate file. The {jesthtmlreporter-content} variable will be replaced with test results. | | collapseSuitesByDefault | boolean | false | Collapse test suites (accordions) by default. | | customScriptPath | string | null | Path to an external script file injected into the report. | | dateFormat | string | yyyy-mm-dd HH:MM:ss | Date format for timestamps. See documentation for available formats. | | executionTimeWarningThreshold | number | 5 | Warn if a test suite exceeds this execution time (in seconds). | | hideConsoleLogOrigin | boolean | true | Hide console.log origin (stack trace) in the report (requires --verbose=false). | | includeConsoleLog | boolean | false | Include console.log outputs in the report (requires --verbose=false). | | includeFailureMsg | boolean | false | Show detailed error messages for failed tests. | | includeStackTrace | boolean | true | Show stack traces for failed tests. | | includeSuiteFailure | boolean | false | Show detailed errors for entire failed test suites. | | includeObsoleteSnapshots | boolean | false | Show obsolete snapshot names. | | logo | string | null | Path to an image file to display in the report header. | | outputPath | string | ./test-report.html | Full path for the output report file (must end in .html). | | pageTitle | string | "Test Report" | Title of the document and top-level heading. | | sort | string | null | Sort test results by a specific method. Available values:status → Sorts by test status (pending → failed → passed).status:{custom-order} → Custom status order (e.g., "status:failed,passed,pending").executionasc → Sorts by execution time ascending.executiondesc → Sorts by execution time descending.titleasc → Sorts by suite filename/test name ascending.titledesc → Sorts by suite filename/test name descending. | | statusIgnoreFilter | string | null | Comma-separated list of statuses to exclude: "passed", "pending", "failed". | | styleOverridePath | string | null | Path to a CSS file to override default styles. | | useCssFile | boolean | false | Link to the CSS file instead of inlining styles. | | theme | string | defaultTheme | Theme that you are able to set to report (defaultTheme or darkTheme) |

Continuous Integration

All the configuration options provided in the table above are available via environment variables and follows the pattern of snake case in uppercase prepended with JEST_HTML_REPORTER_

Example: customScriptPath -> JEST_HTML_REPORTER_CUSTOM_SCRIPT_PATH

*NOTE: Environment variables will take precedence over configurations set in jesthtmlreporter.config.json and package.json*

CI Example

Here is an example of dynamically naming your output file and test report title to match your current branch that one might see in a automated deployment pipeline before running their tests.

export BRANCH_NAME=`git symbolic-ref HEAD 2>/dev/null | cut -d"/" -f 3`
export JEST_HTML_REPORTER_OUTPUT_PATH=/home/username/jest-test-output/test-reports/"$BRANCH_NAME".html
export JEST_HTML_REPORTER_PAGE_TITLE="$BRANCH_NAME"\ Test\ Report