{"id":13769844,"url":"https://github.com/unional/jest-watch-random","last_synced_at":"2025-03-15T11:32:50.447Z","repository":{"id":41063232,"uuid":"196341475","full_name":"unional/jest-watch-random","owner":"unional","description":"jest watch plugin to randomly run some of the test suites","archived":false,"fork":false,"pushed_at":"2024-09-06T08:24:58.000Z","size":1314,"stargazers_count":4,"open_issues_count":29,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-18T06:22:55.007Z","etag":null,"topics":["jest","jest-watch-plugin","testing","tooling","tools"],"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/unional.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},"funding":{"ko_fi":"unional"}},"created_at":"2019-07-11T07:21:29.000Z","updated_at":"2023-05-24T11:45:18.000Z","dependencies_parsed_at":"2024-08-03T17:12:46.028Z","dependency_job_id":null,"html_url":"https://github.com/unional/jest-watch-random","commit_stats":{"total_commits":7,"total_committers":1,"mean_commits":7.0,"dds":0.0,"last_synced_commit":"3b5ab0667f3d113761ac6acce99a45ab246ec259"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unional%2Fjest-watch-random","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unional%2Fjest-watch-random/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unional%2Fjest-watch-random/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unional%2Fjest-watch-random/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unional","download_url":"https://codeload.github.com/unional/jest-watch-random/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221573971,"owners_count":16845944,"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":["jest","jest-watch-plugin","testing","tooling","tools"],"created_at":"2024-08-03T17:00:32.160Z","updated_at":"2024-10-26T19:45:35.026Z","avatar_url":"https://github.com/unional.png","language":"TypeScript","funding_links":["https://ko-fi.com/unional"],"categories":["Packages"],"sub_categories":["Watch plugins"],"readme":"# jest-watch-random\n\n[![NPM version][npm-image]][npm-url]\n[![NPM downloads][downloads-image]][downloads-url]\n[![Mentioned in Awesome Jest](https://awesome.re/mentioned-badge.svg)](https://github.com/jest-community/awesome-jest)\n\n[![Build status][circleci-image]][circleci-url]\n[![Codecov][codecov-image]][codecov-url]\n\n[![Greenkeeper badge][green-keeper-image]][green-keeper-url]\n[![semantic-release][semantic-release-image]][semantic-release-url]\n\nRandomly run some of the test suites (each test file is a test suite in jest).\n\nRequires `jest@23+`.\n\n## Rationale\n\nWhat? How dare you only running part of the tests?\n\nWell yeah, in normal circumstances, you should run all of your tests all the time.\nBut in practice, when you have a huge suite of tests, it is not practical to do that.\n\nIn one of my cases, I have 80k acceptance tests which takes 2 hours to run.\nIn most cases, I use a combination of filtering and `test.skip()/test.only()` to focus on the tests that matter.\n\nBut from time to time you want to run other tests to make sure you are not breaking anything.\n\nThis plugin allows you to do a random spot check to make sure things are working fine.\n\nOf course, you should run a full test at the end of a cycle (end of day / end of sprint / end of release).\n\n## Usage\n\nTo use `jest-watch-random`,\nadd it to the `watchPlugins` section of the Jest configuration:\n\n```js\n{\n  \"jest\": {\n    \"watchPlugins\": [\n      \"jest-watch-random\", // or\n      [\"jest-watch-random\", { \"key\": \"R\", \"prompt\": \"randomly pick some test suites to run\" }]\n    ]\n  }\n}\n```\n\nIn watch mode, press `R` to invoke a prompt and enter the percentage of tests you want to run:\n\n```\nWatch Usage\n › Press a to run all tests.\n › Press f to run only failed tests.\n › Press p to filter by a filename regex pattern.\n › Press t to filter by a test name regex pattern.\n › Press q to quit watch mode.\n › Press R to randomly pick some test suites to run.\n › Press Enter to trigger a test run.\n```\n\n```\nRandom mode usage\n › Press Esc to exit random mode.\n › Press Enter to randomly run n% of the test suites\n random › 10 %\n```\n\n[npm-image]: https://img.shields.io/npm/v/jest-watch-random.svg?style=flat\n[npm-url]: https://npmjs.org/package/jest-watch-random\n[downloads-image]: https://img.shields.io/npm/dm/jest-watch-random.svg?style=flat\n[downloads-url]: https://npmjs.org/package/jest-watch-random\n[circleci-image]: https://circleci.com/gh/unional/jest-watch-random/tree/master.svg?style=shield\n[circleci-url]: https://circleci.com/gh/unional/jest-watch-random/tree/master\n[codecov-image]: https://codecov.io/gh/unional/jest-watch-random/branch/master/graph/badge.svg\n[codecov-url]: https://codecov.io/gh/unional/jest-watch-random\n[green-keeper-image]:\nhttps://badges.greenkeeper.io/unional/jest-watch-random.svg\n[green-keeper-url]:https://greenkeeper.io/\n[semantic-release-image]:https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg\n[semantic-release-url]:https://github.com/semantic-release/semantic-release\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funional%2Fjest-watch-random","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funional%2Fjest-watch-random","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funional%2Fjest-watch-random/lists"}