Skip to content

Commit 4cab4c0

Browse files
test: write test case for --help flag
1 parent 3ebfd82 commit 4cab4c0

3 files changed

Lines changed: 28 additions & 1 deletion

File tree

e2e/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,10 @@ const rootCommand = path.join(process.cwd(), 'bin/docsify');
88

99
test('shows up help message without any args', async t => {
1010
const { stderr } = await execa(rootCommand, {reject: false});
11-
t.snapshot(stderr)
11+
t.snapshot(stderr);
12+
});
13+
14+
test('shows up help message by passing in --help flag', async t => {
15+
const { stdout } = await execa(rootCommand, ['--help']);
16+
t.snapshot(stdout);
1217
});

e2e/index.js.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,28 @@ The actual snapshot is saved in `index.js.snap`.
44

55
Generated by [AVA](https://ava.li).
66

7+
## shows up help message by passing in --help flag
8+
9+
> Snapshot 1
10+
11+
`Usage: docsify <init|serve> <path>␊
12+
13+
Commands:␊
14+
docsify init [path] Creates new docs␊
15+
docsify serve [path] Run local server to preview site.␊
16+
docsify start <path> Server for SSR␊
17+
18+
Global Options␊
19+
--help, -h Show help [boolean]␊
20+
--version, -v Show version number [boolean]␊
21+
22+
Documentation:␊
23+
https://docsifyjs.github.io/docsify␊
24+
https://docsifyjs.github.io/docsify-cli␊
25+
26+
Development:␊
27+
https://github.com/docsifyjs/docsify-cli/blob/master/CONTRIBUTING.md`
28+
729
## shows up help message without any args
830

931
> Snapshot 1

e2e/index.js.snap

45 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)