Socket
Socket
Sign inDemoInstall

jest-html-reporter

Package Overview
Dependencies
3
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    jest-html-reporter

Jest test results processor for generating a summary in HTML


Version published
Weekly downloads
173K
decreased by-15.64%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

jest-html-reporter

A jest test results processor for generating a summary in HTML.

NPM

screenshot

This plugin was inspired by karma-htmlfile-reporter

Installation

npm install jest-html-reporter

Usage

You must configure jest to process the test results by adding the following entry to the jest config:

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

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

Node Compatibility

This plugin is compatible with Node version ^4.8.3

Configuration

The configurations are done directly within your package.json file

pageTitle (string)

[Default: "Test Suite"]

The title of the document. This string will also be outputted on the top of the page.

outputPath (string)

[Default: "./test-report.html"]

The path to where the plugin will output the HTML report. The path must include the filename and end with .html

includeFailureMsg (boolean)

[Default: false]

If this setting is set to true, this will output the detailed failure message for each failed test.

styleOverridePath (string)

[Default: null]

The path to a file containing CSS styles that will override the default styling of the report. The plugin will search for the file from the root directory, therefore there is no need to prepend the string with ./ or ../

Please refer to the file named style.js within the root folder of this plugin for an example of the IDs and classes that are available for styling.

Example configuration (package.json)

{
	...
	"jest-html-reporter": {
		"pageTitle": "Your test suite",
		"outputPath": "test-report/index.html",
		"includeFailureMsg": false,
		"styleOverridePath": "src/teststyle.css"
	}
}

Keywords

FAQs

Last updated on 14 Jul 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc