Socket
Book a DemoInstallSign in
Socket

html-jest-reporter

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

html-jest-reporter

Jest test results processor for generating a summary in HTML

1.0.0
latest
Source
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

html-jest-reporter

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

This plugin was inspired by jest-html-reporter by Johan Hargne

Test Report with flag enabled: screenshot

Test Report with flag disabled: screenshot

Additional Usage of the Plugin

This plugin combines all the Test suite and shows the report in the combined manner at the Top. It can also show the report on the basis of Number of Positive and Negative Test cases (Pre Condition: You will have to prefix your test case name by P_ (For positive Test case) or N_ (For negative Test case))

Installation

npm install html-jest-reporter

Usage

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

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

Then when 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.

Alternative usage with package.json

Although jest.config.js is specifically created for configuring Jest (and not this plugin), it is possible to configure Jest from within package.json by adding the following as a new line:

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

Node Compatibility

This plugin is compatible with Node version ^4.8.3

Configuration

The configurations are done directly within your package.json file

enableCategoryWiseReport (boolean)

[Default: false]

This flag enabled the test case category (Positive or Negative) wise reporting.

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

Example configuration (package.json)

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

Keywords

jest

FAQs

Package last updated on 20 Nov 2017

Did you know?

Socket

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.