{"id":13769242,"url":"https://github.com/dkelosky/jest-stare","last_synced_at":"2025-04-13T18:33:54.287Z","repository":{"id":29304207,"uuid":"121054543","full_name":"dkelosky/jest-stare","owner":"dkelosky","description":"Jest HTML Reporter and Results Processor","archived":false,"fork":false,"pushed_at":"2025-04-05T02:37:27.000Z","size":6676,"stargazers_count":264,"open_issues_count":8,"forks_count":32,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-07T16:50:27.205Z","etag":null,"topics":["html-report","jest","mochawesome","processor","results","results-viewer"],"latest_commit_sha":null,"homepage":"https://dkelosky.github.io/jest-stare/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dkelosky.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-10T21:10:14.000Z","updated_at":"2025-04-02T08:20:58.000Z","dependencies_parsed_at":"2023-09-27T12:58:22.220Z","dependency_job_id":"b8059c36-3faa-4d04-a523-22d0f9ea8a86","html_url":"https://github.com/dkelosky/jest-stare","commit_stats":{"total_commits":901,"total_committers":18,"mean_commits":50.05555555555556,"dds":0.4728079911209767,"last_synced_commit":"fe8cf77b3d2151f6fac4006d9bf084b82401d981"},"previous_names":[],"tags_count":65,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkelosky%2Fjest-stare","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkelosky%2Fjest-stare/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkelosky%2Fjest-stare/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkelosky%2Fjest-stare/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dkelosky","download_url":"https://codeload.github.com/dkelosky/jest-stare/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248760443,"owners_count":21157359,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["html-report","jest","mochawesome","processor","results","results-viewer"],"created_at":"2024-08-03T17:00:20.119Z","updated_at":"2025-04-13T18:33:54.262Z","avatar_url":"https://github.com/dkelosky.png","language":"TypeScript","funding_links":[],"categories":["Packages"],"sub_categories":["Reporters"],"readme":"\u003c!-- [![CircleCI](https://circleci.com/gh/dkelosky/jest-stare.svg?style=svg)](https://circleci.com/gh/dkelosky/jest-stare) --\u003e\n\u003c!-- [![Travis CI](https://travis-ci.com/dkelosky/jest-stare.svg?branch=master)](https://travis-ci.com/dkelosky/jest-stare) --\u003e\n\u003c!-- Builds have been temporarily disabled for public repositories due to a negative credit balance. Please go to the Plan page to replenish your credit balance or alter your Consume paid credits for OSS setting. --\u003e\n[![Azure Pipelines](https://dev.azure.com/dkelosky/dkelosky/_apis/build/status/dkelosky.jest-stare?branchName=master)](https://dev.azure.com/dkelosky/dkelosky/_build/latest?definitionId=1\u0026branchName=master)\n![Node.js CI](https://github.com/dkelosky/jest-stare/actions/workflows/nodejs.yml/badge.svg)\n[![Codecov Coverage](https://img.shields.io/codecov/c/github/dkelosky/jest-stare/master.svg?style=flat-square)](https://codecov.io/gh/dkelosky/jest-stare/)\n[![jest](https://jestjs.io/img/jest-badge.svg)](https://github.com/facebook/jest)\n[![npm version](https://badge.fury.io/js/jest-stare.svg)](https://badge.fury.io/js/jest-stare)\n[![downloads](https://img.shields.io/npm/dm/jest-stare)](https://www.npmjs.com/package/jest-stare)\n[![License](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n# Jest HTML Reporter\n\nThis is a Jest HTML reporter.  It takes summary test results from jest\nand parses them into an HTML file for improved readability and filtering.\n\n![Sample](images/newestSampleReport.png \"Sample Report\")\n\n\n## Features\n\n* filter on pass / failed tests\n* side-by-side snapshot diff\n* chart-summarized information\n* captures raw jest results JSON file\n* link to generated coverage report (if configured)\n* [configuration](#config)\n* [cli](#cli)\n* [api](#api)\n\n## Usage\n\nRun tests or a test with jest and specify `jest-stare` on the `--reporters` option:\n\n* `jest --reporters default jest-stare`\n* `jest --testResultsProcessor=jest-stare`\n\nAlternatively, in your `jest` config within `package.json` set `reporters` to `jest-stare` :\n\n* `\"reporters\": [\"default\", \"jest-stare\"]`\n* `\"testResultsProcessor\": \"./node_modules/jest-stare\"`\n\n`jest-stare` when used as a reporter updates the HTML report on each completed test run.  You can use this to view test output\nthat is incomplete (before each test suite completes).  Refresh your browser to see new tests as each suite completes.\n\nBy default, after a report is generated, output will go to `./jest-stare` and will contain:\n\n* `index.html` - html report\n* `jest-results.json` - raw jest json data\n* `/js` - javascript render files\n* `/css` - css stylings\n\n### Config\n\nYou can configure custom reporters by passing the `jest-stare` config as a [second argument](https://jestjs.io/docs/en/configuration#reporters-array-modulename-modulename-options):\n\n```json\n    \"reporters\": [\n      \"default\",\n      [\n        \"jest-stare\",\n        {\n          \"resultDir\": \"results/jest-stare\",\n          \"reportTitle\": \"jest-stare!\",\n          \"additionalResultsProcessors\": [\n            \"jest-junit\"\n          ],\n          \"coverageLink\": \"../../coverage/lcov-report/index.html\",\n          \"jestStareConfigJson\": \"jest-stare.json\",\n          \"jestGlobalConfigJson\": \"globalStuff.json\"\n        }\n      ]\n    ]\n```\n\n\u003e Note: `testResultsProcessor` will not use config options specified in the way above\n\nOr, do so by adding a `jest-stare` object to your package.json, for example:\n\n```typescript\njest-stare: {\n    ...\n}\n```\n\nYou 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.\n\nWithin the configuration object you can specify the following fields:\n\nField | Environmental Variable | Default | Description | Example\n--- | --- | --- | --- | ---\n`resultDir` | `JEST_STARE_RESULT_DIR` | `jest-stare` | set the results directory | `\"resultDir\": \"results/jest-stare\"`\n`resultJson` |  `JEST_STARE_RESULT_JSON` | `jest-results.json` | indicate the raw JSON results file name | `\"resultJson\": \"data.json\"`\n`resultHtml` |  `JEST_STARE_RESULT_HTML` | `index.html` | indicate the main html file name | `\"resultHtml\": \"main.html\"`\n`log` |  `JEST_STARE_LOG` | `true` | specify whether or not jest-stare should log to the console | `\"log\": false`\n`jestStareConfigJson` |  `JEST_STARE_CONFIG_JSON` |  `undefined` | request to save jest-stare config raw JSON results in the file name | `\"jestStareConfigJson\": \"jest-stare-config.json\"`\n`jestGlobalConfigJson` |  `JEST_STARE_GLOBAL_CONFIG_JSON` |  `undefined` | request to save global config results in the file name | `\"jestGlobalConfigJson\": \"global-config.json\"`\n`report` |  `JEST_STARE_REPORT` |  `undefined` | boolean, set to false to suppress creating a HTML report (JSON only retained) | `\"report\": false`\n`reportTitle` |  `JEST_STARE_REPORT_TITLE` |  `jest-stare!` | string, indicate the title of the report | `\"reportTitle\": \"my title\"`\n`reportHeadline` |  `JEST_STARE_REPORT_HEADLINE` |  `jest-stare` | string, indicate the headline of the report | `\"reportHeadline\": \"my headline\"`\n`reportSummary` |  `JEST_STARE_REPORT_SUMMARY` |  `undefined` | boolean, shows the report summary | `\"reportSummary\": true`\n`additionalResultsProcessors` |  `JEST_STARE_ADDITIONAL_RESULTS_PROCESSORS` | `undefined` | add additional test result processors to produce multiple report |`\"additionalResultsProcessors\": [\"jest-junit\"]`\n`coverageLink` |  `JEST_STARE_COVERAGE_LINK` | `undefined` | link to coverage report if available | `\"coverageLink\": \"../../coverage/lcov-report/index.html\"`\n`disableCharts` |  `JEST_STARE_DISABLE_CHARTS` | `undefined` | hide the doughnut charts in the HTML report | `\"disableCharts\": true`\n`hidePassing` | `JEST_STARE_HIDE_PASSING` | `undefined` | hide passing tests in the report on page load | `\"hidePassing\": true`\n`hideFailing` | `JEST_STARE_HIDE_FAILING` | `undefined` | hide failing tests in the report on page load | `\"hideFailing\": true`\n`hidePending` | `JEST_STARE_HIDE_PENDING` | `undefined` | hide pending tests in the report on page load | `\"hidePending\": true`\n\n### API\n\nYou can programmatically invoke jest-stare and provide jest response data via:\n\n```typescript\n// require jest-stare\nconst processor = require(\"jest-stare\");\n\n// load some jest results JSON data\nconst simplePassingTests = require(\"../__tests__/__resources__/simplePassingTests.json\");\n\n// call jest-stare processor, passing a first parm of the jest json results,\n// and optionally a second parm of jest-stare config\nprocessor(simplePassingTests, {log: false, resultDir: __dirname + \"/output\"});\n```\n\n### CLI\n\nUse the `jest-stare` CLI to create or recreate an HTML report.  You only need to supply an input JSON\nfile containing the jest test results.\n\nYou can invoke `jest-stare` as a CLI after installing globally via `npm install -g jest-stare`.\nOr if jest-stare is a local dependency you can invoke the CLI via `npx jest-stare...`\n\nAssuming that you have a relative file to your current location in a folder \"data\" and\n\"simplePassingTests.json\" contains saved JSON output from a jest test invocation, you can\nrun the CLI providing a single positional input jest JSON file:\n\n```\njest-stare data/simplePassingTests.json\n```\n\nOptionally you can control where the report will be stored using a second positional:\n\n```\njest-stare data/simplePassingTests.json c:/users/myId/desktop/output\n```\n\nThe command response takes a form of:\n\n```\njest-stare was called with programmatic config\n**  jest-stare: wrote output report to c:/users/myId/desktop/output/index.html  **\n```\n\n### Jest Watch\n\nBecause jest-stare writes *.js files when generating a report, you may get an infinite loop when using\n`jest-stare` and `jest --watch`.  Samples of the problem are documented here:\n\n* https://github.com/facebook/jest/issues/3923\n* https://github.com/facebook/jest/issues/2516\n\nTo get around this problem, consider excluding `jest-stare` *.js files from watch via something like this:\n\n```json\n    \"watchPathIgnorePatterns\": [\n      \".*jest-stare.*\\\\.js\"\n    ],\n```\n\n## Contributing\n\nSee [contributing](/CONTRIBUTING.md).\n\n## Acknowledgements\n\nThanks to [dogboydog](https://github.com/dogboydog) and others for additions!\n\nThis project is based on:\n\n* [jQuery](https://jquery.com/)\n* [Bootstrap](https://getbootstrap.com/)\n* [Holder.js](http://holderjs.com/)\n* [Chart.js](http://www.chartjs.org/)\n* [diff2html](https://diff2html.xyz/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdkelosky%2Fjest-stare","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdkelosky%2Fjest-stare","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdkelosky%2Fjest-stare/lists"}