{"id":15845009,"url":"https://github.com/cmorten/ayup","last_synced_at":"2025-07-02T21:06:51.444Z","repository":{"id":36888138,"uuid":"192610357","full_name":"cmorten/ayup","owner":"cmorten","description":"For being lazy with what you test.","archived":false,"fork":false,"pushed_at":"2024-01-28T09:40:41.000Z","size":2282,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-15T14:22:46.605Z","etag":null,"topics":["cli","testing","testing-tool"],"latest_commit_sha":null,"homepage":null,"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/cmorten.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"docs/CODEOWNERS.md","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["cmorten"]}},"created_at":"2019-06-18T20:46:20.000Z","updated_at":"2024-04-09T08:20:21.000Z","dependencies_parsed_at":"2025-04-01T17:46:06.710Z","dependency_job_id":"f9e2c300-f1e9-4cba-ad67-6261f76f249b","html_url":"https://github.com/cmorten/ayup","commit_stats":null,"previous_names":["asos-craigmorten/ayup"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/cmorten/ayup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmorten%2Fayup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmorten%2Fayup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmorten%2Fayup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmorten%2Fayup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cmorten","download_url":"https://codeload.github.com/cmorten/ayup/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmorten%2Fayup/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259989656,"owners_count":22942330,"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","testing","testing-tool"],"created_at":"2024-10-05T17:41:36.439Z","updated_at":"2025-06-17T14:33:55.018Z","avatar_url":"https://github.com/cmorten.png","language":"JavaScript","funding_links":["https://github.com/sponsors/cmorten"],"categories":[],"sub_categories":[],"readme":"# ayup\n\nModule and CLI for listing test files relevant to the changes made in the last commit of a git branch in a repository.\n\nBuilt with the purpose of slimming down the number of tests run in CI. This is done by limiting scope to the tests related to files that actually changed in the last commit, plus any files that import said change files (e.g. parent modules).\n\n## Usage\n\n### CLI Usage\n\n```console\nUsage:\n        [yarn] ayup [flags]\n\nFlags:\n        -d,     --directory             The path of the git repository to analyse.\n        -b,     --branch                The branch of the git repository to analyse.\n```\n\nWhen used as a CLI, the relevant test files are outputted to stdout separated by newlines. For example\n\n```console\n$ ayup\npath/to/test/file1\npath/to/test/file2\n```\n\nTo get the relevant test files for the current working directory and branch run:\n\n```console\nayup\n```\n\nTo get the relevant test files for the `develop` branch of the local repo located at `/path/to/repo/` run:\n\n```console\nayup -d \"/path/to/repo/\" -b \"develop\"\n```\n\nThis can be used in conjunction with testing frameworks, such as jest, in shell scripts like so:\n\n```bash\n#!/bin/bash\n\necho \"Here is the file diff:\"\necho -e \"$(git diff --name-only HEAD HEAD~1)\\n\"\n\nfiles=$(ayup -d ./ -b develop)\n\necho \"Here are the relevant test files:\"\necho -e \"${files}\\n\"\n\nif [ ! -z \"${files}\" ]; then\n  jest test ${files}\nelse\n  echo \"No relevant test files found!\"\nfi\n```\n\n### Module Usage\n\n`ayup` can also be used as an imported module.\n\nTo get the relevant test files for the current working directory and branch run:\n\n```js\nimport ayup from \"ayup\";\n\nconst testFiles = ayup();\n\nconsole.log(testFiles);\n```\n\nTo get the relevant test files for the `develop` branch of the local repo located at `/path/to/repo/` run:\n\n```js\nimport ayup from \"ayup\";\n\nconst testFiles = ayup({ d: \"/path/to/repo/\", b \"develop\" });\n\nconsole.log(testFiles);\n```\n\n#### Options\n\n| Parameter   | Description                                  |\n| ----------- | -------------------------------------------- |\n| `directory` | The path of the git repository to analyse.   |\n| `d`         | Short form of the `directory` parameter.     |\n| `branch`    | The branch of the git repository to analyse. |\n| `b`         | Short form of the `branch` parameter.        |\n\n## Developing\n\n### Install\n\n```console\nyarn install --frozen-lockfile\n```\n\n### Build\n\n```console\nyarn build\n```\n\nTo continuously build while developing by watching changed files use:\n\n```console\nyarn dev\n```\n\n### Lint\n\n```console\nyarn lint\n```\n\n### Test\n\n#### Unit Tests\n\n```console\nyarn test:unit\n```\n\n#### Integration Tests\n\n```console\nyarn test:int\n```\n\nNote that these tests rely on the existence of the built assets.\n\n## Contributing\n\nPlease check out the [CONTRIBUTING](./docs/CONTRIBUTING.md) docs.\n\n## Changelog\n\nPlease check out the [CHANGELOG](./docs/CHANGELOG.md) docs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmorten%2Fayup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcmorten%2Fayup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmorten%2Fayup/lists"}