-
Notifications
You must be signed in to change notification settings - Fork 20
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 mocha.cmd binary lookup #8
Conversation
This line of code was looking for `mocha.cmd` in Mocha's own `bin` folder. This is incorrect; there is no `mocha.cmd` file there. The `mocha.cmd` file is in the `node_modules/.bin` folder. Tested on Windows. Not sure about *nix. There is probably a better way to get to the `node_modules/.bin` folder than this, but it "works for me (tm)".
Provided that |
Published to npm as |
So, on the other hand, there is We could do the equivalent of the following: var fork = require('child_process').fork,
path = require('path');
var args = [/*...*/];
fork(path.join(require.resolve('mocha'), 'bin', '_mocha'), args);
Thoughts? |
@KenPowers Worth a try, IMO, so long as all the CLI arguments are supported (the problem with Mocha's programmatic interface is that many of the CLI args aren't supported). But then you might have to rename this module |
I actually thought of that myself, but then I read
So I think we're good. :P |
Also, it seems like it works as with all flags (such as |
Published |
I will give it a shot tomorrow, thanks! |
This line of code was looking for
mocha.cmd
in Mocha's ownbin
folder.This is incorrect; there is no
mocha.cmd
file there. Themocha.cmd
file is in thenode_modules/.bin
folder.Tested on Windows. Not sure about *nix.
There is probably a better way to get to the
node_modules/.bin
folder than this, but it "works for me (tm)".