Skip to content

Commit 7276f08

Browse files
authored
Better explain the syntax and semantics of CLI pattern arguments
1 parent e13d499 commit 7276f08

File tree

2 files changed

+28
-26
lines changed

2 files changed

+28
-26
lines changed

docs/05-command-line.md

+26-24
Original file line numberDiff line numberDiff line change
@@ -12,36 +12,38 @@ Commands:
1212
ava debug [<pattern>...] Activate Node.js inspector and run a single test
1313
file
1414
ava reset-cache Delete any temporary files and state kept by AVA,
15-
then exit
15+
then exit
1616

1717
Positionals:
1818
pattern Select which test files to run. Leave empty if you want AVA to run
1919
all test files as per your configuration. Accepts glob patterns,
20-
directories that (recursively) contain test files, and file paths.
21-
Add a colon and specify line numbers of specific tests
22-
to run [string]
20+
directories that (recursively) contain test files, and file paths
21+
optionally suffixed with a colon and comma-separated numbers and/or
22+
ranges identifying the 1-based line(s) of specific tests to run
23+
[string]
24+
2325
Options:
24-
--version Show version number [boolean]
25-
--color Force color output [boolean]
26-
--config Specific JavaScript file for AVA to read its config
27-
from, instead of using package.json or ava.config.*
28-
files
29-
--help Show help [boolean]
30-
--concurrency, -c Max number of test files running at the same time
31-
(default: CPU cores) [number]
32-
--no-worker-threads Don't use worker threads [boolean]
33-
--fail-fast Stop after first test failure [boolean]
34-
--match, -m Only run tests with matching title (can be repeated)
26+
--version Show version number [boolean]
27+
--color Force color output [boolean]
28+
--config Specific JavaScript file for AVA to read its config
29+
from, instead of using package.json or ava.config.*
30+
files
31+
--help Show help [boolean]
32+
-c, --concurrency Max number of test files running at the same time
33+
(default: CPU cores) [number]
34+
--fail-fast Stop after first test failure [boolean]
35+
-m, --match Only run tests with matching title (can be repeated)
3536
[string]
36-
--node-arguments Additional Node.js arguments for launching worker
37-
processes (specify as a single string) [string]
38-
--serial, -s Run tests serially [boolean]
39-
--tap, -t Generate TAP output [boolean]
40-
--timeout, -T Set global timeout (milliseconds or human-readable,
41-
e.g. 10s, 2m) [string]
42-
--update-snapshots, -u Update snapshots [boolean]
43-
--verbose, -v Enable verbose output (default) [boolean]
44-
--watch, -w Re-run tests when files change [boolean]
37+
--no-worker-threads Don't use worker threads [boolean]
38+
--node-arguments Additional Node.js arguments for launching worker
39+
processes (specify as a single string) [string]
40+
-s, --serial Run tests serially [boolean]
41+
-t, --tap Generate TAP output [boolean]
42+
-T, --timeout Set global timeout (milliseconds or human-readable,
43+
e.g. 10s, 2m) [string]
44+
-u, --update-snapshots Update snapshots [boolean]
45+
-v, --verbose Enable verbose output (default) [boolean]
46+
-w, --watch Re-run tests when files change [boolean]
4547

4648
Examples:
4749
ava

lib/cli.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export default async function loadCli() { // eslint-disable-line complexity
163163
})
164164
.command('* [<pattern>...]', 'Run tests', yargs => yargs.options(FLAGS).positional('pattern', {
165165
array: true,
166-
describe: 'Select which test files to run. Leave empty if you want AVA to run all test files as per your configuration. Accepts glob patterns, directories that (recursively) contain test files, and file paths. Add a colon and specify line numbers of specific tests to run',
166+
describe: 'Select which test files to run. Leave empty if you want AVA to run all test files as per your configuration. Accepts glob patterns, directories that (recursively) contain test files, and file paths optionally suffixed with a colon and comma-separated numbers and/or ranges identifying the 1-based line(s) of specific tests to run',
167167
type: 'string',
168168
}), argv => {
169169
if (activeInspector) {
@@ -190,7 +190,7 @@ export default async function loadCli() { // eslint-disable-line complexity
190190
},
191191
}).positional('pattern', {
192192
demand: true,
193-
describe: 'Glob patterns to select a single test file to debug. Add a colon and specify line numbers of specific tests to run',
193+
describe: 'Glob pattern to select a single test file to debug, optionally suffixed with a colon and comma-separated numbers and/or ranges identifying the 1-based line(s) of specific tests to run',
194194
type: 'string',
195195
}),
196196
argv => {

0 commit comments

Comments
 (0)