Skip to content

Commit 1df4da9

Browse files
test: write test case for -h flag
1 parent 4cab4c0 commit 1df4da9

3 files changed

Lines changed: 27 additions & 0 deletions

File tree

e2e/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,9 @@ test('shows up help message without any args', async t => {
1414
test('shows up help message by passing in --help flag', async t => {
1515
const { stdout } = await execa(rootCommand, ['--help']);
1616
t.snapshot(stdout);
17+
});
18+
19+
test('shows up help message by passing in -h flag', async t => {
20+
const { stdout } = await execa(rootCommand, ['-h']);
21+
t.snapshot(stdout);
1722
});

e2e/index.js.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,25 @@ Generated by [AVA](https://ava.li).
4949
https://github.com/docsifyjs/docsify-cli/blob/master/CONTRIBUTING.md␊
5050
5151
[ERROR] 0 arguments passed. Please specify a command`
52+
53+
## shows up help message by passing in -h flag
54+
55+
> Snapshot 1
56+
57+
`Usage: docsify <init|serve> <path>␊
58+
59+
Commands:␊
60+
docsify init [path] Creates new docs␊
61+
docsify serve [path] Run local server to preview site.␊
62+
docsify start <path> Server for SSR␊
63+
64+
Global Options␊
65+
--help, -h Show help [boolean]␊
66+
--version, -v Show version number [boolean]␊
67+
68+
Documentation:␊
69+
https://docsifyjs.github.io/docsify␊
70+
https://docsifyjs.github.io/docsify-cli␊
71+
72+
Development:␊
73+
https://github.com/docsifyjs/docsify-cli/blob/master/CONTRIBUTING.md`

e2e/index.js.snap

36 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)