Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upAutomatically set environment for common test frameworks #18
Comments
This comment has been minimized.
This comment has been minimized.
|
The solution is to just do this: /* global beforeEach, describe, it */See this for an example: https://github.com/jprichardson/node-cfs/blob/master/test.js |
This comment has been minimized.
This comment has been minimized.
|
I understand that. As I mentioned, My enhancement request for |
This comment has been minimized.
This comment has been minimized.
|
With $ node test.jsTo me it feels that |
This comment has been minimized.
This comment has been minimized.
How would you recommend we do that?
There is no difference between a non-standard global and a undefined variable. |
This comment has been minimized.
This comment has been minimized.
|
Here is some weird pseudocode.
I fully understand that these globals are nonstandard/undefined (and it's kind of weird that mocha/jasmine /etc are implemented this way, frankly). But |
This comment has been minimized.
This comment has been minimized.
|
You're right, it could. But I think it's more a question of "should". The On Wednesday, February 4, 2015, Brandon Horst notifications@github.com
Simple & Secure Bitcoin Wallet: https://www.coinbolt.com |
This comment has been minimized.
This comment has been minimized.
kytwb
commented
Feb 21, 2015
|
@jprichardson couldn't agree more. |
This comment has been minimized.
This comment has been minimized.
|
Closing this for now, as the consensus seems to be that it's simplest to have mocha users just define globals in a comment. |
brandonhorst commentedFeb 3, 2015
I use
mocha, andstandardcomplains about the undeclared variables (likedescribe,it, andbefore) that it uses. Of course, I can addbut that seems like something that could be handled by
standard. Perhaps inspectingpackage.jsonto look atdependenciesanddirectories.test, or just making some common guesses.Perhaps this is outside of the scope, but it certainly would make me feel more standard if I could just arrange my projects in a specific way and ignore the linter directives entirely.