Skip to content

Commit

Permalink
feat: add -V and --version e2e test (#40)
Browse files Browse the repository at this point in the history
* feat: add -V and --version e2e test

* refactor: run linter

* feat: v and --version test refactor

* refactor: run linter
  • Loading branch information
bdcorps authored and jamesgeorge007 committed Oct 16, 2019
1 parent 5b0df17 commit 6a250a5
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 35 deletions.
65 changes: 30 additions & 35 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,13 @@ test('shows up help message without any args', async t => {
const { stdout } = await execa(rootCommand);
t.snapshot(stdout);
});

test('shows version with arg -V', async t => {
const { stdout } = await execa(rootCommand, ['-V']);
t.snapshot(stdout);
});

test('shows version with arg --version', async t => {
const { stdout } = await execa(rootCommand, ['--version']);
t.snapshot(stdout);
});
12 changes: 12 additions & 0 deletions test/snapshots/index.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,15 @@ Generated by [AVA](https://ava.li).
fetchtask <key> Fetches any task as per the key supplied␊
showkeys Shows keys of all the completed tasks␊
showcommands Shows all commands available`

## shows version with arg --version

> Snapshot 1
'1.1.8'

## shows version with arg -V

> Snapshot 1
'1.1.8'
Binary file modified test/snapshots/index.js.snap
Binary file not shown.

0 comments on commit 6a250a5

Please sign in to comment.