Skip to content
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

global whitelist? #101

Closed
zeke opened this issue Apr 2, 2015 · 5 comments

Comments

@zeke
Copy link
Contributor

commented Apr 2, 2015

I have some mocha test files I want to standardize, but I'm getting errors about describe, it, etc being undefined.

normalize-license* master » standard --format
Error: Use JavaScript Standard Style (https://github.com/feross/standard)
  test/index.js:7:0: 'describe' is not defined.
  test/index.js:8:2: 'describe' is not defined.
  test/index.js:11:4: 'it' is not defined.

I know this is one of the things some people don't like about mocha, but I'm a fan of this design choice, as it reduces boilerplate code in tests. Is there a way to whitelist globals in package.json or something?

@jprichardson

This comment has been minimized.

Copy link
Member

commented Apr 2, 2015

Add this to the top of your file:

/* global describe, it */

On Wednesday, April 1, 2015, Zeke Sikelianos notifications@github.com
wrote:

I have some mocha test files I want to standardize, but I'm getting
errors about describe, it, etc being undefined.

normalize-license* master » standard --format
Error: Use JavaScript Standard Style (https://github.com/feross/standard)
test/index.js:7:0: 'describe' is not defined.
test/index.js:8:2: 'describe' is not defined.
test/index.js:11:4: 'it' is not defined.

I know this is one of the things some people don't like about mocha, but
I'm a fan of this design choice, as it reduces boilerplate code in tests.
Is there a way to whitelist globals in package.json or something?


Reply to this email directly or view it on GitHub
#101.

Simple & Secure Bitcoin Wallet: https://www.coinbolt.com
Bitcoin / JavaScript: http://cryptocoinjs.com
Follow JP Richardson on Twitter: https://twitter.com/jprichardson

@zeke

This comment has been minimized.

Copy link
Contributor Author

commented Apr 2, 2015

🤘

@zeke zeke closed this Apr 2, 2015

@zeke

This comment has been minimized.

Copy link
Contributor Author

commented Apr 2, 2015

For those who stumble upon this issue, @jprichardson's suggestion is a jshint thing: http://jshint.com/docs/

@gabeio

This comment has been minimized.

Copy link

commented Jun 20, 2016

👍 thanks

@ifraixedes

This comment has been minimized.

Copy link

commented Jun 21, 2016

For mocha globals specifics , I use /* eslint-env mocha */

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
4 participants
You can’t perform that action at this time.