Installations
npm install bespoken-jest-stare
Releases
Unable to fetch releases
Developer
Developer Guide
Module System
CommonJS
Min. Node Version
>=6.0.0
Typescript Support
No
Node Version
14.15.1
NPM Version
7.5.3
Statistics
691 Commits
2 Watching
19 Branches
1 Contributors
Updated on 26 May 2021
Languages
HTML (84.14%)
TypeScript (15.49%)
CSS (0.35%)
JavaScript (0.02%)
Total Downloads
Cumulative downloads
Total Downloads
310,763
Last day
-0.9%
109
Compared to previous day
Last week
11.9%
914
Compared to previous week
Last month
-12.5%
3,860
Compared to previous month
Last year
-55.6%
42,630
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
13
Dev Dependencies
25
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
If you need to configure jest-stare
, 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" |
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-html-reporter", "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 |
inlineSource | JEST_STARE_INLINE_SOURCE | false | boolean, create a report in a single file | "inlineSource": true |
generatePdf | JEST_STARE_GENERATE_PDF | false | boolean, generate a pdf version of the report | "generatePdf": true |
generatePdfToken | JEST_STARE_GENERATE_PDF_TOKEN | undefined | API token to generate pdf reports | "generatePdfToken": "[TOKEN]" |
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 for additions to configuration!
This project is based on:
No vulnerabilities found.
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
Found 3/16 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
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
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 21 are checked with a SAST tool
Reason
86 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-6chw-6frg-f759
- Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-cph5-m8f7-6c5x
- Warn: Project is vulnerable to: GHSA-wf5p-g6vw-rhxx
- Warn: Project is vulnerable to: GHSA-vc8w-jr9v-vj7f
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw
- Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5
- Warn: Project is vulnerable to: GHSA-wg6g-ppvx-927h
- Warn: Project is vulnerable to: GHSA-h68q-55jf-x68w
- Warn: Project is vulnerable to: GHSA-mh2h-6j8q-x246
- Warn: Project is vulnerable to: GHSA-5q88-cjfq-g2mh / GHSA-xp63-6vf5-xf3v
- Warn: Project is vulnerable to: GHSA-257v-vj4p-3w2h
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq
- Warn: Project is vulnerable to: GHSA-ff7x-qrg7-qggm
- Warn: Project is vulnerable to: GHSA-vh7m-p724-62c2
- Warn: Project is vulnerable to: GHSA-r9p9-mrjm-926w
- Warn: Project is vulnerable to: GHSA-434g-2637-qmqr
- 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-74fj-2j2h-c42q
- Warn: Project is vulnerable to: GHSA-pw2r-vq6v-hr8c
- Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc
- Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp
- Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44
- Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988
- Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj
- Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37
- Warn: Project is vulnerable to: GHSA-7r28-3m3f-r2pr
- Warn: Project is vulnerable to: GHSA-r8j5-h5cx-65gg
- Warn: Project is vulnerable to: GHSA-gxr4-xjj5-5px2
- Warn: Project is vulnerable to: GHSA-jpcq-cgw6-v4j6
- Warn: Project is vulnerable to: GHSA-896r-f27r-55mw
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp
- Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw
- Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-7wpw-2hjm-89gp
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m / GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-8hfj-j24r-96c4
- Warn: Project is vulnerable to: GHSA-wc69-rhjr-hc9g
- Warn: Project is vulnerable to: GHSA-w7rc-rwvf-8q5r
- Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g
- Warn: Project is vulnerable to: GHSA-92xj-mqp7-vmcj
- Warn: Project is vulnerable to: GHSA-wxgw-qj99-44c2
- Warn: Project is vulnerable to: GHSA-5rrq-pxf6-6jx5
- Warn: Project is vulnerable to: GHSA-8fr3-hfg3-gpgp
- Warn: Project is vulnerable to: GHSA-gf8q-jrpm-jvxq
- Warn: Project is vulnerable to: GHSA-2r2c-g63r-vccr
- Warn: Project is vulnerable to: GHSA-cfm4-qjh2-4765
- Warn: Project is vulnerable to: GHSA-x4jg-mjrx-434g
- Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p
- Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr
- Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9
- Warn: Project is vulnerable to: GHSA-566m-qj78-rww5
- Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j
- Warn: Project is vulnerable to: GHSA-hwj9-h5mp-3pm3
- Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg
- Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p
- Warn: Project is vulnerable to: GHSA-g4rg-993r-mgx7
- Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9
- Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw
- Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc
- Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh
- Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p
- Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36
- Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc
- Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7
- Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
- Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh
- Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp
Score
1.9
/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 More