{"id":34861984,"url":"https://github.com/jaunt/clifry","last_synced_at":"2025-12-25T21:19:45.687Z","repository":{"id":57105581,"uuid":"434080807","full_name":"jaunt/clifry","owner":"jaunt","description":"Node.JS application for functionally testing command line applications (CLI)","archived":false,"fork":false,"pushed_at":"2022-11-03T22:35:51.000Z","size":454,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-13T15:38:53.465Z","etag":null,"topics":["cli","functional-testing","testing","testing-tool","typescript"],"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/jaunt.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}},"created_at":"2021-12-02T04:26:31.000Z","updated_at":"2022-04-29T04:09:09.000Z","dependencies_parsed_at":"2022-08-21T00:31:02.560Z","dependency_job_id":null,"html_url":"https://github.com/jaunt/clifry","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/jaunt/clifry","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaunt%2Fclifry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaunt%2Fclifry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaunt%2Fclifry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaunt%2Fclifry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaunt","download_url":"https://codeload.github.com/jaunt/clifry/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaunt%2Fclifry/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28038032,"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","status":"online","status_checked_at":"2025-12-25T02:00:05.988Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","functional-testing","testing","testing-tool","typescript"],"created_at":"2025-12-25T21:19:42.241Z","updated_at":"2025-12-25T21:19:45.674Z","avatar_url":"https://github.com/jaunt.png","language":"TypeScript","readme":"# [Clifry](https://github.com/jaunt/clifry)\n\n#### Node.JS application for functionally testing command line applications (CLI)\n\n## Design Philosophy\n\nClifry is for black-box testing command line interpreter apps (CLIs).\n\nIts goal is to make functional testing easy by harnessing the simplicity of writing javascript. It offers a very simple workflow and API, honed for running and testing CLIs. Clifry is configuration-file-free, and wants to get out of your way.\n\nClifry doesn't provide much in the way of domain specific testing functionality. It's up to you to use something like the standard unix diff tool if you want to compare human-readable file outputs, or any external tool you need depending on the nature of your CLI. You can easily require npm modules of your choosing in your javascript test files, as long as they are compatible with Node.JS.\n\nClifry will always stay lean and minimal, by design.\n\nNote: Clifry was created to test black-box test Airfry, a javascript static site generator. So it's battle tested in that way.\n\n## How To Write Tests\n\nClifry will run tests against a CLI that you specify as an argument. You write tests as separate javascript files. Clifry will find and run through them.\n\nA clifry test file must accept an instance of the api object, and return a promise to resolve (pass) or reject (fail) the test.\n\nThe API object passed to your test provides a minimal set of functions designed to make it easy to interact with your CLI for functional testing purposes.\n\nMost of these functions are designed to be used with javascript's [async await mechanism](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Asynchronous/Async_await), in order to keep the flow\nof your tests clean and easy to read.\n\n##### Example test.js file: Run python interactively to make sure it can do math!\n\n```javascript\nconst test = (CliFry) =\u003e {\n  return new Promise(async function (resolve, reject) {\n    const testRun = CliFry(\n      {\n        name: \"Simple Test\",\n        description: \"Run python, do math, exit.\",\n      },\n      // arguments\n      [\"-i\", \"-q\"]\n    );\n\n    try {\n      await testRun.start(100);\n\n      await testRun.untilStderrIncludes(\"\u003e\u003e\u003e\", 5000);\n\n      testRun.write(\"10+10\");\n\n      await testRun.untilStdoutIncludes(\"20\", 2000);\n\n      await testRun.untilOutputIdleSeconds(1, 2000);\n\n      testRun.write(\"exit()\");\n\n      await testRun.untilStopped(1000);\n\n      resolve(\"success\");\n    } catch (error) {\n      reject(\"Python can't do math!\");\n    }\n  });\n};\n\nmodule.exports = test;\n```\n\nHopefully the above is somewhat self explanatory.\n\nOf course testing _stdout_ and _stderr_ is only one aspect of testing a CLI. In the case of Airfry, a static site generator, the clifry tests were written to use the unix diff command to compare site outputs at different points in time. Refer to the [Airfry test folder in git](https://github.com/jaunt/airfryts/tree/main/tests) to see how it works.\n\nClifry is designed so that you include the 3rd party libraries you need to test the domain specific data you are testing for within your javascript test files. You can use npm and require as you desire. Perhaps you want to compare audio or video files at each step of the test. There's probably an npm module for that!\n\nClifry was written in typescript and so the test API documentation has been kept that way\nto show you the types of the interface. Your test files must be javascript, but if\nyou want to write them in typescript you could always set up a pre-compile step in your environment.\n\n## How to run Clifry\n\nTODO -\u003e NPM INSTALL INSTRUCTIONS\n\nCreate a parent test folder in your project, then create a child folder for each test you want to run.\n\nThe child folder names become the test names you can run using the Clifry's -t argument.\n\n#### Optionally call Clifry with the following arguments:\n\n**-f, --folder**\n\nThe parent folder for all of your child test folders (defaults to ./tests)\n\n**-t, --tests**\n\nOne or more test names (folder names). If not specified, Clifry will run all that it finds in the parent test folder.\n\n**-c, --cli**\n\nThe path to the normal CLI you are testing\n\n**-n, --node**\n\nThe path to the node CLI you are testing\n\n##### You must specify either a node or a regular binary cli, but not both.\n\n## Api\n\n#### [Documentation](https://jaunt.github.io/clifry/classes/ClifryAPI.html)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaunt%2Fclifry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaunt%2Fclifry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaunt%2Fclifry/lists"}