Using JSHint with Mocha and Chai -


I am running the MOCHA test (as an unbreakable library with the CHI).

JSHIT Fire is currently a warning every time he encounters a line like this:

Expectancy (mistake) .to.be.null;

The problem reported is: / p>

Expected an identifier and instead saw 'tap' (a reserved word).

Does JSHint have any comfort options to fix this problem? At the moment, the only solution I have found is that the file contains special options at the beginning of the file:

/ * jshint-W024 * /

problem with it This is that it needs to be included in each test file (and I have to separate the JSHIT option from the code myself). I think there is a lot in it.

You can enter the following settings: at the top level of your test suite {"Expr": true, "es5": true}

In a .jshintrc file I'm still on version 1.1.0 jshint and thus both settings are required, but apparently 2.0.0 version and above es5 is set to true by default expr setting is documented. There is probably no reference to es5 because it is the default and can not be turned off (if you try to set it manually, then Zinc 2.0.0 will increase an error.)

The file used when checking a file is by looking at a .jshintrc file if not found in the same directory as your file, then It looks a level above if there is no found Another level looks up, etc.

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -