{"id":13727456,"url":"https://github.com/Hargne/jest-html-reporter","last_synced_at":"2025-05-07T22:31:14.563Z","repository":{"id":18883048,"uuid":"85297644","full_name":"Hargne/jest-html-reporter","owner":"Hargne","description":"Jest test results processor for generating a summary in HTML","archived":false,"fork":false,"pushed_at":"2025-03-12T22:57:46.000Z","size":1403,"stargazers_count":278,"open_issues_count":1,"forks_count":76,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-05-01T15:53:40.058Z","etag":null,"topics":["html-report","jest","processor","reporter","test"],"latest_commit_sha":null,"homepage":null,"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/Hargne.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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},"funding":{"github":["Hargne"],"custom":["https://paypal.me/hargne"]}},"created_at":"2017-03-17T10:04:51.000Z","updated_at":"2025-03-26T15:18:15.000Z","dependencies_parsed_at":"2024-06-02T18:31:12.182Z","dependency_job_id":"1a0bfa92-6a58-4012-9ac3-a8c5b8258e18","html_url":"https://github.com/Hargne/jest-html-reporter","commit_stats":{"total_commits":189,"total_committers":24,"mean_commits":7.875,"dds":"0.44973544973544977","last_synced_commit":"19c89444ca59e4446f203fccb7026faf427813da"},"previous_names":[],"tags_count":68,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hargne%2Fjest-html-reporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hargne%2Fjest-html-reporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hargne%2Fjest-html-reporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hargne%2Fjest-html-reporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Hargne","download_url":"https://codeload.github.com/Hargne/jest-html-reporter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252965436,"owners_count":21832890,"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","processor","reporter","test"],"created_at":"2024-08-03T01:03:57.595Z","updated_at":"2025-05-07T22:31:14.554Z","avatar_url":"https://github.com/Hargne.png","language":"TypeScript","funding_links":["https://github.com/sponsors/Hargne","https://paypal.me/hargne"],"categories":["Packages","TypeScript"],"sub_categories":["Reporters"],"readme":"\u003cp align=\"center\"\u003e\n\t\u003cp align=\"center\"\u003e📜\u003c/p\u003e\n\t\u003ch3 align=\"center\"\u003ejest-html-reporter\u003c/h3\u003e\n\t\u003cp align=\"center\"\u003e\n\t\tA \u003ca href=\"https://github.com/facebook/jest\"\u003eJest\u003c/a\u003e test results processor for generating a summary in HTML.\n\t\t\u003cbr /\u003e\n\t\t\u003cbr /\u003e\n\t\t\u003cimg src=\"https://img.shields.io/npm/v/jest-html-reporter?style=flat-square\"\u003e\n\t\t\u003cimg src=\"https://img.shields.io/node/v/jest-html-reporter?style=flat-square\"\u003e\n\t\t\u003cimg src=\"https://img.shields.io/npm/dm/jest-html-reporter?style=flat-square\"\u003e\n\t\t\u003cbr /\u003e\n\t\t\u003cbr /\u003e\n\t\t\u003csmall\u003eInspired by \u003ca href=\"https://github.com/matthias-schuetz/karma-htmlfile-reporter\"\u003ekarma-htmlfile-reporter\u003c/a\u003e\u003c/small\u003e\n\t\t\u003cbr /\u003e\n\t\t\u003cbr /\u003e\n\t\t\u003cdiv style=\"text-align:center\"\u003e\n\t\t\t\u003cimg src=\"https://user-images.githubusercontent.com/3501024/77887991-d511c480-726b-11ea-9ed8-2e581206900c.png\" alt=\"\" style=\"max-width:75%\"\u003e\n\t\t\u003c/div\u003e\n\t\t\u003cbr /\u003e\n\t\t\u003cbr /\u003e\n\t\u003c/p\u003e\n\u003c/p\u003e\n\n## Installation\n\n**npm:**\n\n```\n$ npm install jest-html-reporter --save-dev\n```\n\n**yarn:**\n\n```\n$ yarn add jest-html-reporter --dev\n```\n\n## Usage\n\nConfigure Jest to process the test results by adding the following entry to the Jest config (jest.config.json):\n\n```JSON\n\"reporters\": [\n\t\"default\",\n\t[\"./node_modules/jest-html-reporter\", {\n\t\t\"pageTitle\": \"Test Report\"\n\t}]\n]\n```\n\nAs 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.\n\nThere are multiple configuration options available. Read more about these further down in this document.\n\n#### Alternative Usage as a Test Results Processor\n\nTo 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):\n\n```JSON\n{\n\t\"testResultsProcessor\": \"./node_modules/jest-html-reporter\"\n}\n```\n\n**Note:** When running as a testResultsProcessor, the configuration needs either to be placed within a new file named `jesthtmlreporter.config.json` residing in the root folder\n\n```JSON\n{\n\t\"pageTitle\": \"Test Report\",\n}\n```\n\nor via adding a key to `package.json` named \"jest-html-reporter\":\n\n```JSON\n{\n\t...\n\t\"jest-html-reporter\": {\n\t\t\"pageTitle\": \"Test Report\",\n\t}\n}\n```\n\n## 📌 Configuration Options (All Optional)\n\n| Option                              | Type                                       | Default               | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |\n| ----------------------------------- | ------------------------------------------ | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| **`additionalInformation`**         | `Array\u003c{ label: string; value: string; }\u003e` | `null`                | A list of additional information to be added to the top of the report.                                                                                                                                                                                                                                                                                                                                                                                                                                                         |\n| **`append`**                        | `boolean`                                  | `false`               | Append test results to an existing report.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |\n| **`boilerplate`**                   | `string`                                   | `null`                | Path to an HTML boilerplate file. The `{jesthtmlreporter-content}` variable will be replaced with test results.                                                                                                                                                                                                                                                                                                                                                                                                                |\n| **`collapseSuitesByDefault`**       | `boolean`                                  | `false`               | Collapse test suites (accordions) by default.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |\n| **`customScriptPath`**              | `string`                                   | `null`                | Path to an external script file injected into the report.                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |\n| **`dateFormat`**                    | `string`                                   | `yyyy-mm-dd HH:MM:ss` | Date format for timestamps. See [documentation](https://github.com/Hargne/jest-html-reporter/wiki/Date-Format) for available formats.                                                                                                                                                                                                                                                                                                                                                                                          |\n| **`executionTimeWarningThreshold`** | `number`                                   | `5`                   | Warn if a test suite exceeds this execution time (in seconds).                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |\n| **`includeConsoleLog`**             | `boolean`                                  | `false`               | Include `console.log` outputs in the report (**requires** `--verbose=false`).                                                                                                                                                                                                                                                                                                                                                                                                                                                  |\n| **`includeFailureMsg`**             | `boolean`                                  | `false`               | Show detailed error messages for failed tests.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |\n| **`includeStackTrace`**             | `boolean`                                  | `true`                | Show stack traces for failed tests.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |\n| **`includeSuiteFailure`**           | `boolean`                                  | `false`               | Show detailed errors for entire failed test suites.                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |\n| **`includeObsoleteSnapshots`**      | `boolean`                                  | `false`               | Show obsolete snapshot names.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |\n| **`logo`**                          | `string`                                   | `null`                | Path to an image file to display in the report header.                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |\n| **`outputPath`**                    | `string`                                   | `./test-report.html`  | Full path for the output report file (**must end in `.html`**).                                                                                                                                                                                                                                                                                                                                                                                                                                                                |\n| **`pageTitle`**                     | `string`                                   | `\"Test Report\"`       | Title of the document and top-level heading.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |\n| **`sort`**                          | `string`                                   | `null`                | Sort test results by a specific method. Available values:\u003cbr\u003e ➤ **`status`** → Sorts by test status (**pending → failed → passed**).\u003cbr\u003e ➤ **`status:{custom-order}`** → Custom status order (e.g., `\"status:failed,passed,pending\"`).\u003cbr\u003e ➤ **`executionasc`** → Sorts by execution time **ascending**.\u003cbr\u003e ➤ **`executiondesc`** → Sorts by execution time **descending**.\u003cbr\u003e ➤ **`titleasc`** → Sorts by suite filename/test name **ascending**.\u003cbr\u003e ➤ **`titledesc`** → Sorts by suite filename/test name **descending**. |\n| **`statusIgnoreFilter`**            | `string`                                   | `null`                | **Comma-separated** list of statuses to exclude: `\"passed\"`, `\"pending\"`, `\"failed\"`.                                                                                                                                                                                                                                                                                                                                                                                                                                          |\n| **`styleOverridePath`**             | `string`                                   | `null`                | Path to a CSS file to override default styles.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |\n| **`useCssFile`**                    | `boolean`                                  | `false`               | Link to the CSS file instead of inlining styles.                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |\n\n## Continuous Integration\n\nAll the configuration options provided in the table above are available via environment variables and follows the pattern of snake case in uppercase prepended with `JEST_HTML_REPORTER_`\n\n**Example:** `customScriptPath` -\u003e `JEST_HTML_REPORTER_CUSTOM_SCRIPT_PATH`\n\n**\\*NOTE:** Environment variables will take precedence over configurations set in jesthtmlreporter.config.json and package.json\\*\n\n### CI Example\n\nHere 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.\n\n```bash\nexport BRANCH_NAME=`git symbolic-ref HEAD 2\u003e/dev/null | cut -d\"/\" -f 3`\nexport JEST_HTML_REPORTER_OUTPUT_PATH=/home/username/jest-test-output/test-reports/\"$BRANCH_NAME\".html\nexport JEST_HTML_REPORTER_PAGE_TITLE=\"$BRANCH_NAME\"\\ Test\\ Report\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHargne%2Fjest-html-reporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FHargne%2Fjest-html-reporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHargne%2Fjest-html-reporter/lists"}