Skip to content

Commit c9f4671

Browse files
committed
-J is a flag, not an option
1 parent 028eee2 commit c9f4671

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

bin/run.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,14 @@ function parseArgs (args, defaults) {
152152
c: 'color',
153153
C: 'no-color',
154154
T: 'no-timeout',
155+
J: 'jobs-auto',
155156
h: 'help',
156157
'?': 'help',
157158
v: 'version'
158159
}
159160

160161
var singleOpts = {
161162
j: 'jobs',
162-
J: 'jobs-auto',
163163
R: 'reporter',
164164
t: 'timeout',
165165
s: 'save'

test/runner-jobs.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,26 @@ var args = [
1010
['-J'],
1111
['--jobs=99999', '-J'],
1212
['--jobs-auto'],
13-
['--jobs=99999', '--jobs-auto']
13+
['--jobs=99999', '--jobs-auto'],
14+
[ '-JbC', { jobs: expect.jobs, bail: true, reporter: 'tap', color: false } ]
1415
]
1516

1617
t.plan(args.length)
1718

1819
args.forEach(function (arg) {
20+
var ex = expect
21+
if (typeof arg[arg.length - 1] !== 'string')
22+
ex = arg.pop()
1923
t.test(arg.join(' '), function (t) {
20-
var child = spawn(node, [run, '-J', '--dump-config'])
24+
var child = spawn(node, [run].concat(arg).concat('--dump-config'))
2125
var out = ''
2226
child.stdout.on('data', function (c) {
2327
out += c
2428
})
2529
child.on('close', function (code, signal) {
2630
t.notOk(code)
2731
t.notOk(signal)
28-
t.match(JSON.parse(out), expect)
32+
t.match(JSON.parse(out), ex)
2933
t.end()
3034
})
3135
})

0 commit comments

Comments
 (0)