![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
jest-html-reporter
Advanced tools
Readme
A jest test results processor for generating a summary in HTML.
This plugin was inspired by karma-htmlfile-reporter
npm install jest-html-reporter
Configure Jest to process the test results by adding the following entry to the Jest config (jest.config.js):
{
"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 information about your tests.
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/jest-html-reporter" }
This plugin is compatible with Node version ^4.8.3
The configurations are done directly within your package.json file
[Default: "Test Suite"]
The title of the document. This string will also be outputted on the top of the page.
[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
[Default: false]
If this setting is set to true, this will output the detailed failure message for each failed test.
[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 ../
Have a look at the default styling (located within this repository at src/style.js) for a reference to the IDs and classes available for styling.
{
...
"jest-html-reporter": {
"pageTitle": "Your test suite",
"outputPath": "test-report/index.html",
"includeFailureMsg": false,
"styleOverridePath": "src/teststyle.css"
}
}
The output path and report title can be set with an environment variable for dynamic file saving paths in different environments.
Values in package.json will take precedence over environment variables.
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 TEST_REPORT_PATH=/home/username/jest-test-output/test-reports/"$BRANCH_NAME".html
export TEST_REPORT_TITLE="$BRANCH_NAME"\ Test\ Report
FAQs
Jest test results processor for generating a summary in HTML
The npm package jest-html-reporter receives a total of 167,190 weekly downloads. As such, jest-html-reporter popularity was classified as popular.
We found that jest-html-reporter demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
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.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.