{"id":19964403,"url":"https://github.com/arve0/test_terminal_apps","last_synced_at":"2025-10-29T01:05:59.688Z","repository":{"id":66164333,"uuid":"58327225","full_name":"arve0/test_terminal_apps","owner":"arve0","description":"test console applications with node","archived":false,"fork":false,"pushed_at":"2016-05-30T17:43:10.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-12T08:24:49.894Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/arve0.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":"2016-05-08T19:17:03.000Z","updated_at":"2016-05-08T19:17:22.000Z","dependencies_parsed_at":"2023-03-13T09:30:32.142Z","dependency_job_id":null,"html_url":"https://github.com/arve0/test_terminal_apps","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arve0%2Ftest_terminal_apps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arve0%2Ftest_terminal_apps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arve0%2Ftest_terminal_apps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arve0%2Ftest_terminal_apps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arve0","download_url":"https://codeload.github.com/arve0/test_terminal_apps/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241396776,"owners_count":19956408,"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-11-13T02:23:24.754Z","updated_at":"2025-10-29T01:05:54.649Z","avatar_url":"https://github.com/arve0.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# test terminal applications\nThis boilerplate shows how you can test console programs with [ava](https://github.com/sindresorhus/ava).\n\nTesting is done by forking a child process, then listening to the child's\n`stdout` and sending characters to the child's `stdin` with help from [tty-test-helper](https://github.com/arve0/tty-test-helper).\n\nYou may test for:\n\n- Initial output\n- Response in output to particular input\n- If child process is alive\n- Etc..\n\n## What does the tests look like?\nTest a terminal app that writes `.` to `stdout` upon input:\n\n```js\ntest('any keypress gives . in terminal', async (t) =\u003e {\n\tconst { next, stdin } = t.context\n\t// get initial output\n\t// default timeout is 1000 ms, which will throw and fail the test\n\tlet output = await next()\n\n  // start listening for next output\n\toutput = next()\n\t// send a character\n\tstdin.write('a')\n\t// wait until we get the output\n\toutput = await output\n\t// expect the output to be '.'\n\tt.true(output === '.')\n\n\t// do once more with another character\n\toutput = next()\n\tstdin.write('1')\n\toutput = await output\n\tt.true(output === '.')\n})\n```\nFor more details, see [index.js](index.js) and [index.test.js](index.test.js).\n\n## Usage\n```sh\ngit clone https://github.com/arve0/test_terminal_apps\ncd test_terminal_apps\nnpm install\n```\n\nStart the tests:\n```sh\nnpm test\n```\n\n## Additional files\n\n`.eslintrc`:\n\nI have these plugins installed globally.\n\n```sh\nnpm i -g eslint eslint-config-standard eslint-plugin-promise eslint-plugin-standard\n```\n\n`jsconfig.conf`:\n\nUsed by [Visual Studio Code](http://code.visualstudio.com/) for Intellisense auto completion.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farve0%2Ftest_terminal_apps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farve0%2Ftest_terminal_apps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farve0%2Ftest_terminal_apps/lists"}