Gathering detailed insights and metrics for jest-html-reporter
Gathering detailed insights and metrics for jest-html-reporter
Gathering detailed insights and metrics for jest-html-reporter
Gathering detailed insights and metrics for jest-html-reporter
jest-stare
jest html reporter (results processor) to view HTML jest results, save raw JSON, and invoke multiple reporters
bespoken-jest-stare
jest html reporter (results processor) to view HTML jest results, save raw JSON, and invoke multiple reporters
jest-stare-2
jest html reporter (results processor) to view HTML jest results, save raw JSON, and invoke multiple reporters
jest-junit
A jest reporter that generates junit xml files
Jest test results processor for generating a summary in HTML
npm install jest-html-reporter
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
275 Stars
294 Commits
76 Forks
7 Watching
5 Branches
16 Contributors
Updated on 28 Oct 2024
TypeScript (92.61%)
CSS (6.54%)
JavaScript (0.85%)
Cumulative downloads
Total Downloads
Last day
-4.5%
50,630
Compared to previous day
Last week
5.9%
273,376
Compared to previous week
Last month
18.1%
1,091,880
Compared to previous month
Last year
17.6%
11,014,168
Compared to previous year
2
📜
A Jest test results processor for generating a summary in HTML.
Documentation »
Inspired by karma-htmlfile-reporter
npm:
$ npm install jest-html-reporter --save-dev
yarn:
$ yarn add jest-html-reporter --dev
Configure Jest to process the test results by adding the following entry to the Jest config (jest.config.json):
1"reporters": [ 2 "default", 3 ["./node_modules/jest-html-reporter", { 4 "pageTitle": "Test Report" 5 }] 6]
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. To read more about these, please refer to the documentation.
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):
1{ 2 "testResultsProcessor": "./node_modules/jest-html-reporter" 3}
Note: When running as a testResultsProcessor, the configuration needs be placed within a new file named jesthtmlreporter.config.json
residing in the root folder.
More information about this can be found in the documentation.
This plugin is compatible with Node version ^4.8.3
Please note that all configuration properties are optional.
Property | Type | Description | Default |
---|---|---|---|
append | BOOLEAN | If set to true, new test results will be appended to the existing test report | false |
boilerplate | STRING | The path to a boilerplate file that should be used to render the body of the test results into. {jesthtmlreporter-content} within the boilerplate will be replaced with the test results | null |
collapseSuitesByDefault | BOOLEAN | Whether to collapse test suites by default or not | false |
customScriptPath | STRING | Path to a javascript file that should be injected into the test report | null |
dateFormat | STRING | The format in which date/time should be formatted in the test report. Have a look in the documentation for the available date format variables. | "yyyy-mm-dd HH:MM:ss" |
executionTimeWarningThreshold | NUMBER | The threshold for test execution time (in seconds) in each test suite that will render a warning on the report page. 5 seconds is the default timeout in Jest. | 5 |
includeConsoleLog | BOOLEAN | If set to true, this will output all triggered console logs for each test suite. Please note that you have to run Jest together with --verbose=false in order to have Jest catch any logs during the tests. | false |
includeFailureMsg | BOOLEAN | If this setting is set to true, this will output the detailed failure message for each failed test. | false |
includeStackTrace | BOOLEAN | Turning this option off will cut the stack trace from the failure messages. | true |
includeSuiteFailure | BOOLEAN | If set to true, this will output the detailed failure message for complete suite failures. | false |
includeObsoleteSnapshots | BOOLEAN | If set to true, this will output obsolete snapshot names. | false |
logo | STRING | Path to a logo that will be included in the header of the report | null |
outputPath | STRING | The path to where the plugin will output the HTML report. The path must include the filename and end with .html | "./test-report.html" |
pageTitle | STRING | The title of the document. This string will also be outputted on the top of the page. | "Test Suite" |
sort | STRING | Sorts the test results using the given method. Available sorting methods can be found in the documentation. | "default" |
statusIgnoreFilter | STRING | A comma-separated string of the test result statuses that should be ignored when rendering the report. Available statuses are: "passed" , "pending" , "failed" | null |
styleOverridePath | STRING | The path to a file containing CSS styles that should override the default styling.* | null |
useCssFile | BOOLEAN | If set to true, the CSS styles will link in the current theme's .css file instead of inlining its content on the page | false |
*The plugin will search for the *styleOverridePath* from the root directory, therefore there is no need to prepend the string with
./
or../
- You can read more about the themes in the documentation.
Configuration may also be performed with environment variables for dynamic file saving paths in different environments. *NOTE: Environment variables will take precedence over configurations set in jesthtmlreporter.config.json and package.json*
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.
1export BRANCH_NAME=`git symbolic-ref HEAD 2>/dev/null | cut -d"/" -f 3` 2export JEST_HTML_REPORTER_OUTPUT_PATH=/home/username/jest-test-output/test-reports/"$BRANCH_NAME".html 3export JEST_HTML_REPORTER_PAGE_TITLE="$BRANCH_NAME"\ Test\ Report
The environment variables reflect the configuration options available in JSON format. Please read the documentation for more information on these variables.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
5 existing vulnerabilities detected
Details
Reason
Found 3/14 approved changesets -- score normalized to 2
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More