-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix passing of args intended for node/iojs. #1567
Conversation
@travisjeffery This seems to work :) iojs $ node --version
v1.4.3
$ cat example.js
it('test', function(done) {
setTimeout(() => done(), 0);
});
// Before PR
$ ./bin/mocha --harmony_arrow_functions example.js
events.js:141
throw er; // Unhandled 'error' event
^
Error: spawn --harmony_arrow_functions ENOENT
at exports._errnoException (util.js:734:11)
at Process.ChildProcess._handle.onexit (child_process.js:1022:32)
at child_process.js:1114:20
at process._tickCallback (node.js:350:11)
at Function.Module.runMain (module.js:487:11)
at startup (node.js:112:16)
at node.js:863:3
// After PR
$ ./bin/mocha --harmony_arrow_functions example.js
․
1 passing (8ms) node $ node --version
v0.12.0
danielstjules:~/git/mocha (master =)
$ cat example.js
it('test', function(done) {
var fn = function*() {};
done();
});
// Before PR
$ ./bin/mocha --harmony-generators example.js
events.js:85
throw er; // Unhandled 'error' event
^
Error: spawn --harmony-generators ENOENT
at exports._errnoException (util.js:746:11)
at Process.ChildProcess._handle.onexit (child_process.js:1046:32)
at child_process.js:1137:20
at process._tickCallback (node.js:355:11)
at Function.Module.runMain (module.js:503:11)
at startup (node.js:129:16)
at node.js:814:3
// After PR
$ ./bin/mocha --harmony-generators example.js
․
1 passing (5ms) |
+1 1430c2b break all tests with |
ping @travisjeffery |
+1 from me :) |
This is also related to #1583 |
@tawdle Any chance you could add a regression test for this? If not, I can fork this PR and add one. |
+1 from me, rolling back. |
@travisjeffery @boneskull Think we could merge this in and do a quick patch release? I'll see if I can write an acceptance/regression test for this afterward. |
Fix passing of args intended for node/iojs.
Awesome, thanks. Published 2.2.1 with this |
The recent commit 1430c2b inadvertently broke the ability pass arguments to node/iojs before running mocha -- note that arguments intended for the executable are prepended to args; the previous commit assumes that args[0] will be the executable, but that is only correct if no args intended for the executable have been
unshift
ed onto args.So, if you try, for instance:
mocha --harmony ...
... you'll get an
ENOENT
error asspawn
tries to execute a file named--harmony
.See #1548 for the origin of this issue.