A CLI check that command exit status is expected.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
lib
.gitignore
.travis.yml
LICENSE
README.md
package.json
yarn.lock

README.md

expected-exit-status Build Status

A CLI check that command exit status is expected.

  • Cross platform(Windows/Linux/macOS) support
  • Test command's exit code

Install

Install with npm:

npm install expected-exit-status

Usage

Usage
  $ expected-exit-status <status-code> --command <command>

Options:
  --command Execute command

Examples
  $ expected-exit-status 1 --command "exit 1"
  // $? => 0
  $ expected-exit-status 0 --command "exit 1"
  // $? => 1

Usecase

If you want to test if "abc-command" should be failed(exit status 1), you can write following.

$ expected-exit-status 1 --command "abc-command"

Changelog

See Releases page.

Running tests

Install devDependencies and Run npm test:

npm i -d && npm test

Contributing

Pull requests and stars are always welcome.

For bugs and feature requests, please create an issue.

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Author

License

MIT © azu