-
Notifications
You must be signed in to change notification settings - Fork 61
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
How to tell grunt-mocha-test to use the mocha.opts file from the test folder? #7
Comments
I have found in the past that calling mocha programatically is not the same as calling it from the command line and the same arguments are not necessarily supported (we had a similar issue with --require which I managed to simulate). I believe in this case you can specify the ui option as a field in
As it may not be possible to support all command line arguments (or even simulate them as I did with --require) I don't think I want to open the can of worms that might come with trying to support the To get a fuller idea of what is supported in the https://github.com/visionmedia/mocha/wiki/Using-mocha-programmatically |
First of all: Thanks a lot for replying that fast :-)! I understand the issue you have, and your suggestion of using
works perfectly. The downside is that if you also want to be able to run But anyway, it works. Thanks for your help :-)! |
Your welcome. Yeah, I can see the problem. I'm tempted to raise an issue against Mocha - it seems to me that attempting to fix that here would be very fragile if mocha ever changed its options (I think this is already a problem with the way I dealt with --require) |
In mocha you can use a file called
mocha.opts
to provide cli arguments to the mocha process. This file needs to be in thetest
folder.Anyway, if I simply put
into my
Gruntfile.js
, mocha complains aboutsuite
not being defined, although the filemocha.opts
exists and contains the line:Any ideas on how to solve this?
It looks as if mocha, if run by grunt-mocha-test, does not load this file at all.
The text was updated successfully, but these errors were encountered: