Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
xudafeng committed Sep 25, 2016
1 parent 2c700e0 commit c417d86
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ $ npm i command-line-test --save-dev

## Usage

`fork`, `spawn`, `exec`, `execFile` supported.

```javascript
describe('test', function() {
it('constructor should be ok', function() {
Expand All @@ -36,6 +38,14 @@ describe('test', function() {
it('exec method should be ok with yeild', function *() {
const cliTest = new CliTest();
const res = yield cliTest.exec('cat package.json');
/**
* res return
* {
* error,
* stdout,
* stderr
* }
*/
const _pkg = JSON.parse(res.stdout);
pkg.name.should.be.equal(_pkg.name);
});
Expand Down

0 comments on commit c417d86

Please sign in to comment.