0.3.3 • Published 10 years ago

shy v0.3.3

Weekly downloads
3
License
MIT
Repository
github
Last release
10 years ago

shy

shy is a simple mocha extension that enables to write functional tests for your node based command line application.

Let's create the simplest cli app possible: echojs

First install the required dependencies

npm install mocha shy --save-dev

Create the executable js file (./bin/echojs.js)

#!/usr/bin/env node
process.stdout.write(process.argv.slice(2).join(' ') + '\n');

Configure package.json properly

...
"bin": {
	"echojs": "./bin/echojs.js"
},
"scripts": {
    "test": "./node_modules/.bin/_mocha --compilers shy:shy 
}
...

Write a simple functional test (./test/multi_input.shy)

shy track 'echojs hello world'

shy assert {stdout} = "hello world\n"

Run the tests

npm test
0.3.3

10 years ago

0.3.2

10 years ago

0.3.1

10 years ago

0.3.0

10 years ago

0.2.0

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago