Skip to content

Commit 70b7ad5

Browse files
committed
Add commont jest arguments to test command
Test command allows all jest cli flags to be passed through. But it is important to document via our `--help` output at least the basics to elude to new users that it is available.
1 parent d413aa4 commit 70b7ad5

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

commands/local/test.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,21 @@ module.exports.command = 'test';
22
module.exports.aliases = ['t'];
33
module.exports.desc = 'Run your projects tests';
44

5-
module.exports.builder = function builder() {};
5+
module.exports.builder = function builder(yargs) {
6+
yargs.option('testNamePattern=[query]', {
7+
nargs: 1,
8+
string: true,
9+
requiresArg: true,
10+
description: 'Run only tests with a name that matches the regex',
11+
});
12+
13+
yargs.option('runInBand', {
14+
description:
15+
'Run all tests serially in the current process, rather than creating a worker pool of child processes that run tests. This can be useful for debugging.',
16+
});
17+
18+
return yargs;
19+
};
620

721
module.exports.handler = function handler() {
822
require('jest').run();

0 commit comments

Comments
 (0)