{"id":16170428,"url":"https://github.com/corentinth/comest","last_synced_at":"2025-04-07T07:29:15.771Z","repository":{"id":47835040,"uuid":"271462635","full_name":"CorentinTh/comest","owner":"CorentinTh","description":"Small and lightweight cli-testing framework.","archived":false,"fork":false,"pushed_at":"2022-07-21T03:25:46.000Z","size":73,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-13T15:15:59.392Z","etag":null,"topics":[],"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/CorentinTh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-11T05:49:13.000Z","updated_at":"2023-09-08T18:08:38.000Z","dependencies_parsed_at":"2022-09-17T15:00:34.707Z","dependency_job_id":null,"html_url":"https://github.com/CorentinTh/comest","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CorentinTh%2Fcomest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CorentinTh%2Fcomest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CorentinTh%2Fcomest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CorentinTh%2Fcomest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CorentinTh","download_url":"https://codeload.github.com/CorentinTh/comest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247611184,"owners_count":20966489,"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":"2024-10-10T03:18:43.589Z","updated_at":"2025-04-07T07:29:15.749Z","avatar_url":"https://github.com/CorentinTh.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# comest\n\nSmall and lightweight cli-testing framework.\n\n## Installation\nYou can run `comest` without installing it by using `npx`:\n```shell\nnpx comest\n``` \nOr you can install it by running:\n```shell\nnpm i -g comest\n\n# use it by typing\ncomest\n```\n\n## Usage\nCreate test files matching `*.test.yml` like `myFile.test.yml` in a folder `test`.\n\n### Basic example\n\nThis test run the command `echo foo` and checks 'yo' has been printed on stdout.\n```yaml\nname: Simple echo test\ncommand: echo foo\nexpect:\n  status: 0\n  stdout: foo\n```\n\nThis test run the command `echo foo \u0026\u0026 exit 42` and checks 'yo' has been printed on stdout and return value is 42.\n```yaml\nname: Simple echo test\ncommand: echo foo \u0026\u0026 exit 42\nexpect:\n  status: 42\n  stdout: foo\n```\n### With files\nThis test will create a tmp file containing \"Lorem ipsum\" and will replace `{file1}` with the absolute path of the tmp file ni the command, and execute it. It will then compare the result of the command with the things in **expect**.  \n\n```yaml\nname: Print file content\ncommand: cat {file1}\nassets:\n  - type: file\n    name: file1\n    content: Lorem ipsum\nexpect:\n  status: 0\n  stdout: Lorem ipsum\n```\nThis test will fail because the expectation is different\n```yaml\nname: Print file content\ncommand: cat {file1}\nassets:\n  - type: file\n    name: file1\n    content: Lorem ipsum\nexpect:\n  status: 0\n  stdout: dolor sit amet\n```\n\n### Multiline \nAccording to the YAML [specification](https://yaml-multiline.info/), I suggest using `|-` for multiline (as it keep line break but not the last one).\n```yaml\nname: Print my C file content\ncommand: cat {file1}\nassets:\n  - type: file\n    name: file1\n    content: |-\n        int main () {\n            return 56;\n        }\nexpect:\n  status: 0\n  stdout: |-\n      int main () {\n          return 56;\n      }\n```\n\n### Multi steps\n\n```yaml\nname: Steps demo\nassets:\n  - type: file\n    name: file1\nsteps:\n  - command: echo \"foo\" \u003e {file1}\n    expect:\n      status: 0\n  - command: echo \"bar\" \u003e\u003e {file1}\n  - command: cat {file1}\n    expect:\n      status: 0\n      stdout: |-\n        foo\n        bar\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorentinth%2Fcomest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcorentinth%2Fcomest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorentinth%2Fcomest/lists"}