{"id":16592712,"url":"https://github.com/arielshaqed/specshell","last_synced_at":"2025-07-15T11:05:18.270Z","repository":{"id":57367215,"uuid":"206024181","full_name":"arielshaqed/specshell","owner":"arielshaqed","description":"Control a program (typically a shell) over standard I/O for testing it","archived":false,"fork":false,"pushed_at":"2019-11-25T10:07:38.000Z","size":25,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-30T05:37:41.943Z","etag":null,"topics":["hacktoberfest","integration-testing","javascript","shell","testing-tools","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/arielshaqed.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":"2019-09-03T08:11:06.000Z","updated_at":"2020-10-05T16:40:46.000Z","dependencies_parsed_at":"2022-08-23T20:10:13.960Z","dependency_job_id":null,"html_url":"https://github.com/arielshaqed/specshell","commit_stats":null,"previous_names":["binaris/specshell"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/arielshaqed/specshell","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arielshaqed%2Fspecshell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arielshaqed%2Fspecshell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arielshaqed%2Fspecshell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arielshaqed%2Fspecshell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arielshaqed","download_url":"https://codeload.github.com/arielshaqed/specshell/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arielshaqed%2Fspecshell/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265430265,"owners_count":23763966,"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":["hacktoberfest","integration-testing","javascript","shell","testing-tools","typescript"],"created_at":"2024-10-11T23:22:01.353Z","updated_at":"2025-07-15T11:05:17.943Z","avatar_url":"https://github.com/arielshaqed.png","language":"TypeScript","readme":"[![Build status](https://github.com/binaris/specshell/workflows/Node%20CI/badge.svg)](https://github.com/binaris/specshell/actions)\n# specshell\n\nWrite JavaScript specs for shell commands\n\n## Installation\n\nFor use only within your tests:\n```sh\nnpm install --save-dev specshell\n```\nMore advanced usage may require:\n```sh\nnpm install --save specshell\n```\n\n## Features\n\n- Use any test framework (or none)\n- Use JavaScript or TypeScript\n\n## Quick start: testing shell commands\n\nWrite shell tests using your preferred test framework.  Use\n`specshell` to run shell commands.\n\n```js\nconst specshell = require('specshell');\n```\n\nCreate a new shell.\n\n```js\nconst shell = new specshell.Shell();\n```\n\nSend it a command and examine the results.  Another process is\ninvolved so you must `await` the results of running any shell command.\n(Your test framework should support this; most do, including Jest,\nMocha and Ava).\n\n```js\nconst assert = require('assert').strict;\n\nasync function test() {\n  const { out, err } = await shell.run('echo hello, shell');\n  assert.equal(out.toString(), 'hello, shell');\n  assert.equal(err.toString(), '');\n}\ntest();\n```\n\n`Shell.run` returns `exitCode` or `signal` for each command run.  If\nthe shell itself dies it throws `specshell.ShellError`.\n\n## API\n\n### Shell\n\n#### constructor`(shellPath, spawnOptions)`\n\nConstructs to use a shell found at `shellPath` (default `'/bin/bash'`)\npassing `spawnOptions`.  Currently these are the same as for\n[`child_process.spawn`][spawn_options], but option `stdio` will be\nignored if you pass it.\n\n### `run(script)`\n\nRuns `script` inside shell: passes every line to the shell and a newline at the end.  \n\n\n[spawn_options]: https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farielshaqed%2Fspecshell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farielshaqed%2Fspecshell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farielshaqed%2Fspecshell/lists"}