{"id":15590837,"url":"https://github.com/jasonetco/test-selector","last_synced_at":"2025-07-13T07:40:26.750Z","repository":{"id":98866254,"uuid":"102669839","full_name":"JasonEtco/test-selector","owner":"JasonEtco","description":"🎭👈 Prompts the user to run specific test suites in a project.","archived":false,"fork":false,"pushed_at":"2018-05-01T04:24:15.000Z","size":54,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-12T15:23:52.891Z","etag":null,"topics":["cli","mocha","npm-scripts","suite","test","test-selector","test-suite","testing"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JasonEtco.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2017-09-06T23:59:22.000Z","updated_at":"2021-03-11T17:52:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"f73e19cc-4022-42f7-9b58-662ff6102125","html_url":"https://github.com/JasonEtco/test-selector","commit_stats":{"total_commits":48,"total_committers":2,"mean_commits":24.0,"dds":0.02083333333333337,"last_synced_commit":"d32ae6f3dd16d64e6d4ba34d8e9ba4ff623de869"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JasonEtco%2Ftest-selector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JasonEtco%2Ftest-selector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JasonEtco%2Ftest-selector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JasonEtco%2Ftest-selector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JasonEtco","download_url":"https://codeload.github.com/JasonEtco/test-selector/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253764085,"owners_count":21960510,"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":["cli","mocha","npm-scripts","suite","test","test-selector","test-suite","testing"],"created_at":"2024-10-02T23:30:08.486Z","updated_at":"2025-05-12T15:23:59.173Z","avatar_url":"https://github.com/JasonEtco.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Test Selector \u0026middot; [![npm version](https://img.shields.io/npm/v/test-selector.svg?style=flat)](https://www.npmjs.com/package/test-selector) [![Build Status](https://img.shields.io/travis/JasonEtco/test-selector.svg)](https://travis-ci.org/JasonEtco/test-selector) [![Coverage Status](https://coveralls.io/repos/github/JasonEtco/test-selector/badge.svg?branch=master)](https://coveralls.io/github/JasonEtco/test-selector?branch=master)\n\nA helper CLI tool to make it easier to run just the tests you want to run.\n\n`test-selector` will look through your `package.json` file's scripts object and pick out the ones following the `test:testName` scheme. It will then ask you which one of those tests you want to run! Or, if you already know the test you want to run, you can include its name in the command.\n\n## Installation\n\n```bash\n$ npm install -g test-selector --save\n```\n\n### Basic usage\n\n```bash\n$ tst\n```\n\n![tst](https://user-images.githubusercontent.com/10660468/30186825-2353275e-93f5-11e7-9d4e-22abc78769fb.gif)\n\n### Run a specific test\n\nAlready know which test you want to run? Cool! The following command is the same as `npm run test:api`.\n\n```bash\n$ tst api\n```\nOutput:\n```\n[tst] Running the test suite: api\n```\n\n## Setting up your tests\n\n`tst` assumes that your `package.json` file's scripts object is formatted like this:\n\n```json\n{\n  \"scripts\": {\n    \"test\": \"test for things\",\n    \"test:api\": \"test just the api\",\n    \"test:compiler\": \"test just the compiler\"\n  }\n}\n```\n\n### Available options\n\n| Option | Default | Description |\n| ------ | ------- | ----------- |\n| `-p`, `--prefix` | `'test'` | A string that comes before all tests. |\n| `-s`, `--separator` | `':'` | Character that separates the prefix from the test name. |\n\nYou can use these options like this:\n\n```bash\n$ tst --prefix unit-test --separator -\n```\n\nThis will suggest any scripts that look like `unit-test-TESTNAME`.\n\n### Configuration in your `package.json` file\n\nYou may also add a `\"tst\"` object to your project's `package.json` file.\n\n```json\n{\n  \"scripts\": {\n    \"test\": \"test for things\",\n    \"unit-test-api\": \"test just the api\",\n  },\n  \"tst\": {\n    \"prefix\": \"unit-test\",\n    \"separator\": \"-\"\n  }\n}\n```\n\n## Writing your tests\n\nFor each testing library, there's a different way to separate your tests if you don't want to run them all. I'm not an expert in every testing library, so here are a few resources you can look at:\n\n- [Mocha's --grep option](https://mochajs.org/#-g---grep-pattern)\n- [Jest CLI docs](http://facebook.github.io/jest/docs/en/cli.html)\n\n## Contributing\n\nI'd love your contributions! Feel free to open up an issue or submit a PR. Thanks 💖\n\n## Changelog\n\n- 1.0.0 - Initial release\n- 1.0.1 - Enable settings in `package.json`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjasonetco%2Ftest-selector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjasonetco%2Ftest-selector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjasonetco%2Ftest-selector/lists"}