{"id":26716603,"url":"https://github.com/javascript-studio/related-tests","last_synced_at":"2025-06-21T06:06:48.072Z","repository":{"id":57163250,"uuid":"333207475","full_name":"javascript-studio/related-tests","owner":"javascript-studio","description":"🎓 Run related tests with lint-staged","archived":false,"fork":false,"pushed_at":"2021-06-05T09:48:25.000Z","size":251,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-18T19:49:20.221Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/javascript-studio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-26T20:24:02.000Z","updated_at":"2021-06-05T09:58:16.000Z","dependencies_parsed_at":"2022-09-12T10:51:57.443Z","dependency_job_id":null,"html_url":"https://github.com/javascript-studio/related-tests","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/javascript-studio/related-tests","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javascript-studio%2Frelated-tests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javascript-studio%2Frelated-tests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javascript-studio%2Frelated-tests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javascript-studio%2Frelated-tests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/javascript-studio","download_url":"https://codeload.github.com/javascript-studio/related-tests/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javascript-studio%2Frelated-tests/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260838480,"owners_count":23070599,"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":[],"created_at":"2025-03-27T15:37:58.375Z","updated_at":"2025-06-21T06:06:43.057Z","avatar_url":"https://github.com/javascript-studio.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Studio Related Tests\n\n🎓 Run related tests with `lint-staged`.\n\n\u003e Runs a command with all tests for staged files named `${filename}.test.js`,\n\u003e `${filename}-test.js`, `${filename}_anything.test.js`,\n\u003e `${filename}-anything.test.js` or `${filename}.anything.test.js`.\n\n## Setup\n\nThis assumes you have [husky][] and [lint-staged][] installed.\n\n```bash\nnpm i @studio/related-tests -D\n```\n\n**lint-staged.config.js**\n\n```js\nconst withRelatedTests = require('@studio/related-tests');\n\nmodule.exports = {\n  '*.js': withRelatedTests('mocha')\n};\n```\n\n## Tip\n\nTo run the same test command, configure a `test:files` script and call\n`withRelatedTests('npm run test:files')`:\n\n```json\n{\n  \"scripts\": {\n    \"test\": \"npm run test:files -- './{,!(node_modules)/**}/*.test.js'\",\n    \"test:files\": \"mocha --require test/hooks.js\"\n  }\n}\n```\n\n[husky]: https://github.com/typicode/husky\n[lint-staged]: https://github.com/okonet/lint-staged\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjavascript-studio%2Frelated-tests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjavascript-studio%2Frelated-tests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjavascript-studio%2Frelated-tests/lists"}