Reputation: 44051
I'm trying to follow along with
http://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options
In an effort to do
./node_modules/.bin/mocha --reporter json -u tdd
I have tried
var mocha = spawn('./node_modules/.bin/mocha', ['--reporter json -u tdd']);
But I get the following error
error: unknown option `--reporter json -u tdd'
What am I doing wrong?
Upvotes: 2
Views: 1406
Reputation: 398
Looking quickly at the reference URL you provided, it seems that your bracketed arguments need to be separate:
var mocha = spawn('./node_modules/.bin/mocha', ['--reporter','json','-u','tdd']);
Upvotes: 9