Skip to content

Commit

Permalink
-J is a flag, not an option
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Mar 2, 2017
1 parent 028eee2 commit c9f4671
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bin/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,14 @@ function parseArgs (args, defaults) {
c: 'color',
C: 'no-color',
T: 'no-timeout',
J: 'jobs-auto',
h: 'help',
'?': 'help',
v: 'version'
}

var singleOpts = {
j: 'jobs',
J: 'jobs-auto',
R: 'reporter',
t: 'timeout',
s: 'save'
Expand Down
10 changes: 7 additions & 3 deletions test/runner-jobs.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,26 @@ var args = [
['-J'],
['--jobs=99999', '-J'],
['--jobs-auto'],
['--jobs=99999', '--jobs-auto']
['--jobs=99999', '--jobs-auto'],
[ '-JbC', { jobs: expect.jobs, bail: true, reporter: 'tap', color: false } ]
]

t.plan(args.length)

args.forEach(function (arg) {
var ex = expect
if (typeof arg[arg.length - 1] !== 'string')
ex = arg.pop()
t.test(arg.join(' '), function (t) {
var child = spawn(node, [run, '-J', '--dump-config'])
var child = spawn(node, [run].concat(arg).concat('--dump-config'))
var out = ''
child.stdout.on('data', function (c) {
out += c
})
child.on('close', function (code, signal) {
t.notOk(code)
t.notOk(signal)
t.match(JSON.parse(out), expect)
t.match(JSON.parse(out), ex)
t.end()
})
})
Expand Down

0 comments on commit c9f4671

Please sign in to comment.