Skip to content

Commit

Permalink
docs(readme): add setup guide & usage example
Browse files Browse the repository at this point in the history
  • Loading branch information
antongolub committed Sep 24, 2019
1 parent 4c61295 commit 328eedd
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,24 @@
# stdstream-snapshot
Weak referenced array
Tiny util for CLI testing: fetch stdout, stderr streams and match data to snapshot

## Install
```bash
yarn add stdstream-snapshot -D
npm add stdstream-snapshot -D
```

## Usage
```javascript
import {match} from 'stdstream-snapshot'

it('cmd output matches to spapshot', () => {
const cmd = 'somecmd --flag=foo -b'
const path = './test/snapshots/some-cmd-output.json'

expect(match({
cmd,
path,
update: true
})).toBeTruthy()
})
```

0 comments on commit 328eedd

Please sign in to comment.