{"id":13769323,"url":"https://github.com/MatteoH2O1999/github-actions-jest-reporter","last_synced_at":"2025-05-11T02:32:26.157Z","repository":{"id":62671703,"uuid":"561526245","full_name":"MatteoH2O1999/github-actions-jest-reporter","owner":"MatteoH2O1999","description":"A reporter allowing for fast and easy navigation through the logs produced by Jest in the Github Actions UI","archived":false,"fork":false,"pushed_at":"2024-10-30T00:53:11.000Z","size":31330,"stargazers_count":14,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-30T01:50:50.360Z","etag":null,"topics":["actions","github-actions","jest","jest-reporter","testing"],"latest_commit_sha":null,"homepage":"","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/MatteoH2O1999.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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":"2022-11-03T22:09:41.000Z","updated_at":"2024-10-29T23:17:15.000Z","dependencies_parsed_at":"2024-04-15T02:32:40.479Z","dependency_job_id":"95c2320d-ae21-41a0-9a4f-74ad0c1ceed2","html_url":"https://github.com/MatteoH2O1999/github-actions-jest-reporter","commit_stats":{"total_commits":60,"total_committers":3,"mean_commits":20.0,"dds":0.5,"last_synced_commit":"74341b05d6b0498db2e18e53ea89faa8b5133776"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatteoH2O1999%2Fgithub-actions-jest-reporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatteoH2O1999%2Fgithub-actions-jest-reporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatteoH2O1999%2Fgithub-actions-jest-reporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatteoH2O1999%2Fgithub-actions-jest-reporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MatteoH2O1999","download_url":"https://codeload.github.com/MatteoH2O1999/github-actions-jest-reporter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225004576,"owners_count":17405644,"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":["actions","github-actions","jest","jest-reporter","testing"],"created_at":"2024-08-03T17:00:21.896Z","updated_at":"2024-11-17T05:30:46.996Z","avatar_url":"https://github.com/MatteoH2O1999.png","language":"TypeScript","funding_links":[],"categories":["Packages"],"sub_categories":["Reporters"],"readme":"# Github Actions Jest reporter\n\n[![Tests](https://github.com/MatteoH2O1999/github-actions-jest-reporter/actions/workflows/test.yml/badge.svg)](https://github.com/MatteoH2O1999/github-actions-jest-reporter/actions/workflows/test.yml)\n![Downloads](https://img.shields.io/npm/dw/@matteoh2o1999/github-actions-jest-reporter)\n![License](https://img.shields.io/npm/l/@matteoh2o1999/github-actions-jest-reporter)\n[![Version](https://img.shields.io/npm/v/@matteoh2o1999/github-actions-jest-reporter)](https://www.npmjs.com/package/@matteoh2o1999/github-actions-jest-reporter)\n![Node](https://img.shields.io/node/v/@matteoh2o1999/github-actions-jest-reporter)\n\nA fast and easy way of navigating through the logs produced by Jest in the Github Actions UI.\n\n![reporter demo](./demos/demo.gif)\n\n## Motivation\n\nJest's default reporter omits all of the datails of the passed and outputs a continuous log of the failed ones.\nWhile this is useful in a local development environment, it becomes cumbersome to read as a github action log.\nThe aim of this reporter is to log all the results (including passed tests), but folding them neatly as groups leveraging Github Actions builtin group function.\nLogs of failures are grouped and folded by test file so they can be opened and read in a more organized way.\n\n![reporter error log demo](./demos/error_log_demo.gif)\n\n## Dependencies\n\nThe package depends on `jest` (obviously), `chalk` and the `@actions/core` package.\n\n## Installation\n\nThe reporter can be installed directly from npm:\n\n```bash\nnpm install --save-dev @matteoh2o1999/github-actions-jest-reporter\n```\n\n## Usage\n\nThere are two ways to use the reporter in your Jest testing.\n\n### Create CI test script (recommended)\n\nIn your `package.json` just add a line in your script section:\n\n```diff\n{\n    ...\n    \"scripts\": {\n        ...\n        \"test\": \"jest\",\n+       \"test-ci\": \"jest --reporters='@matteoh2o1999/github-actions-jest-reporter'\"\n    }\n}\n```\n\nThen in your `test.yml` use the new script instead of the old one:\n\n```diff\nsteps:\n  - name: Checkout code\n  ...\n  - name: Run tests\n-   run: npm run test\n+   run: npm run test-ci\n```\n\n### Add as reporter in `jest.config`\n\nAdd the reporter to the `reporters` array in your configuration file:\n\n```diff\nmodule.exports: {\n    ...\n-   reporters: [...],\n+   reporters: [..., '@matteoh2o1999/github-actions-jest-reporter'],\n}\n```\n\n\u003e :warning: **Warning:** adding this reporter in your `jest.config` file will also impact local testing.\n\n## Troubleshooting\n\n### My logs are not colored\n\nThis is a known problem related to `chalk` not recognizing Github Actions terminal as capable of writing colors.\n\nUntil this is fixed on their end a workaround is to force color output with an environment variable:\n\n```diff\nsteps:\n  - name: Checkout code\n  ...\n  - name: Run tests\n    run: npm run test-ci\n+   env:\n+     FORCE_COLOR: 1\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMatteoH2O1999%2Fgithub-actions-jest-reporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMatteoH2O1999%2Fgithub-actions-jest-reporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMatteoH2O1999%2Fgithub-actions-jest-reporter/lists"}