cli-tester
Lean promisified wrapper to test NodeJS CLI scripts
Plays nicely with blue-tape
Installation
npm install --save-dev cli-tester
Usage
const test = ;const tester = ; ; ;
Node 5 and older
const tester = ;
API
Returns ES6 Promise, that is always successful
cli - string
Resolved path to JS CLI, ideally absolute path
env (optional) - object
Object with ENV vars
...args (optional) - string
List of command line arguments
// With omitted ENV // With ENV
Development and testing
Currently is being developed and tested with the latest stable Node 7
under OSX
and Windows
.
git clone git@github.com:nkbt/cli-tester.gitcd cli-testernpm install
Tests
# to run tests npm test # to generate test coverage (./coverage) npm run cov
License
MIT