Installations
npm install jest-stare
Score
63.8
Supply Chain
83
Quality
73.4
Maintenance
100
Vulnerability
97.1
License
Developer
Developer Guide
Module System
CommonJS
Min. Node Version
>=6.0.0
Typescript Support
No
Node Version
20.13.1
NPM Version
10.5.2
Statistics
263 Stars
1,407 Commits
31 Forks
7 Watching
18 Branches
14 Contributors
Updated on 02 Aug 2024
Bundle Size
426.88 kB
Minified
118.26 kB
Minified + Gzipped
Languages
TypeScript (94.27%)
HTML (3.45%)
CSS (2.18%)
JavaScript (0.1%)
Total Downloads
Cumulative downloads
Total Downloads
8,900,958
Last day
-5.3%
9,252
Compared to previous day
Last week
17.5%
58,300
Compared to previous week
Last month
9.7%
218,512
Compared to previous month
Last year
23.7%
2,429,815
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
16
Jest HTML Reporter
This is a Jest HTML reporter. It takes summary test results from jest and parses them into an HTML file for improved readability and filtering.
Features
- filter on pass / failed tests
- side-by-side snapshot diff
- chart-summarized information
- captures raw jest results JSON file
- link to generated coverage report (if configured)
- configuration
- cli
- api
Usage
Run tests or a test with jest and specify jest-stare
on the --reporters
option:
jest --reporters default jest-stare
jest --testResultsProcessor=jest-stare
Alternatively, in your jest
config within package.json
set reporters
to jest-stare
:
"reporters": ["default", "jest-stare"]
"testResultsProcessor": "./node_modules/jest-stare"
jest-stare
when used as a reporter updates the HTML report on each completed test run. You can use this to view test output
that is incomplete (before each test suite completes). Refresh your browser to see new tests as each suite completes.
By default, after a report is generated, output will go to ./jest-stare
and will contain:
index.html
- html reportjest-results.json
- raw jest json data/js
- javascript render files/css
- css stylings
Config
You can configure custom reporters by passing the jest-stare
config as a second argument:
1 "reporters": [ 2 "default", 3 [ 4 "jest-stare", 5 { 6 "resultDir": "results/jest-stare", 7 "reportTitle": "jest-stare!", 8 "additionalResultsProcessors": [ 9 "jest-junit" 10 ], 11 "coverageLink": "../../coverage/lcov-report/index.html", 12 "jestStareConfigJson": "jest-stare.json", 13 "jestGlobalConfigJson": "globalStuff.json" 14 } 15 ] 16 ]
Note:
testResultsProcessor
will not use config options specified in the way above
Or, do so by adding a jest-stare
object to your package.json, for example:
1jest-stare: { 2 ... 3}
You can also configure each option via environmental variables instead. Environmental variables take precedence over values in package.json. CLI options take precedence of environmental variables and configuration.
Within the configuration object you can specify the following fields:
Field | Environmental Variable | Default | Description | Example |
---|---|---|---|---|
resultDir | JEST_STARE_RESULT_DIR | jest-stare | set the results directory | "resultDir": "results/jest-stare" |
resultJson | JEST_STARE_RESULT_JSON | jest-results.json | indicate the raw JSON results file name | "resultJson": "data.json" |
resultHtml | JEST_STARE_RESULT_HTML | index.html | indicate the main html file name | "resultHtml": "main.html" |
log | JEST_STARE_LOG | true | specify whether or not jest-stare should log to the console | "log": false |
jestStareConfigJson | JEST_STARE_CONFIG_JSON | undefined | request to save jest-stare config raw JSON results in the file name | "jestStareConfigJson": "jest-stare-config.json" |
jestGlobalConfigJson | JEST_STARE_GLOBAL_CONFIG_JSON | undefined | request to save global config results in the file name | "jestGlobalConfigJson": "global-config.json" |
report | JEST_STARE_REPORT | undefined | boolean, set to false to suppress creating a HTML report (JSON only retained) | "report": false |
reportTitle | JEST_STARE_REPORT_TITLE | jest-stare! | string, indicate the title of the report | "reportTitle": "my title" |
reportHeadline | JEST_STARE_REPORT_HEADLINE | jest-stare | string, indicate the headline of the report | "reportHeadline": "my headline" |
reportSummary | JEST_STARE_REPORT_SUMMARY | undefined | boolean, shows the report summary | "reportSummary": true |
additionalResultsProcessors | JEST_STARE_ADDITIONAL_RESULTS_PROCESSORS | undefined | add additional test result processors to produce multiple report | "additionalResultsProcessors": ["jest-junit"] |
coverageLink | JEST_STARE_COVERAGE_LINK | undefined | link to coverage report if available | "coverageLink": "../../coverage/lcov-report/index.html" |
disableCharts | JEST_STARE_DISABLE_CHARTS | undefined | hide the doughnut charts in the HTML report | "disableCharts": true |
hidePassing | JEST_STARE_HIDE_PASSING | undefined | hide passing tests in the report on page load | "hidePassing": true |
hideFailing | JEST_STARE_HIDE_FAILING | undefined | hide failing tests in the report on page load | "hideFailing": true |
hidePending | JEST_STARE_HIDE_PENDING | undefined | hide pending tests in the report on page load | "hidePending": true |
API
You can programmatically invoke jest-stare and provide jest response data via:
1// require jest-stare 2const processor = require("jest-stare"); 3 4// load some jest results JSON data 5const simplePassingTests = require("../__tests__/__resources__/simplePassingTests.json"); 6 7// call jest-stare processor, passing a first parm of the jest json results, 8// and optionally a second parm of jest-stare config 9processor(simplePassingTests, {log: false, resultDir: __dirname + "/output"});
CLI
Use the jest-stare
CLI to create or recreate an HTML report. You only need to supply an input JSON
file containing the jest test results.
You can invoke jest-stare
as a CLI after installing globally via npm install -g jest-stare
.
Or if jest-stare is a local dependency you can invoke the CLI via npx jest-stare...
Assuming that you have a relative file to your current location in a folder "data" and "simplePassingTests.json" contains saved JSON output from a jest test invocation, you can run the CLI providing a single positional input jest JSON file:
jest-stare data/simplePassingTests.json
Optionally you can control where the report will be stored using a second positional:
jest-stare data/simplePassingTests.json c:/users/myId/desktop/output
The command response takes a form of:
jest-stare was called with programmatic config
** jest-stare: wrote output report to c:/users/myId/desktop/output/index.html **
Jest Watch
Because jest-stare writes *.js files when generating a report, you may get an infinite loop when using
jest-stare
and jest --watch
. Samples of the problem are documented here:
To get around this problem, consider excluding jest-stare
*.js files from watch via something like this:
1 "watchPathIgnorePatterns": [ 2 ".*jest-stare.*\\.js" 3 ],
Contributing
See contributing.
Acknowledgements
Thanks to dogboydog and others for additions!
This project is based on:
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
SAST tool detected but not run on all commits
Details
- Info: SAST configuration detected: CodeQL
- Warn: 21 commits out of 25 are checked with a SAST tool
Reason
8 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m
- Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw
- Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p
- Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
Reason
dependency not pinned by hash detected -- score normalized to 1
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/dkelosky/jest-stare/codeql-analysis.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/dkelosky/jest-stare/codeql-analysis.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:56: update your workflow using https://app.stepsecurity.io/secureworkflow/dkelosky/jest-stare/codeql-analysis.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:70: update your workflow using https://app.stepsecurity.io/secureworkflow/dkelosky/jest-stare/codeql-analysis.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/dkelosky/jest-stare/nodejs.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/dkelosky/jest-stare/nodejs.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/stale.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/dkelosky/jest-stare/stale.yml/master?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/nodejs.yml:28
- Info: 0 out of 7 GitHub-owned GitHubAction dependencies pinned
- Info: 1 out of 2 npmCommand dependencies pinned
Reason
Found 0/8 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql-analysis.yml:28
- Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql-analysis.yml:29
- Warn: no topLevel permission defined: .github/workflows/codeql-analysis.yml:1
- Warn: no topLevel permission defined: .github/workflows/nodejs.yml:1
- Warn: no topLevel permission defined: .github/workflows/stale.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Score
3.7
/10
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 MoreOther packages similar to jest-stare
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/types
This package contains shared types of Jest's packages.
babel-jest
Jest plugin to use babel for transformation.