Search code examples
node.jsjenkinsmocha.jsjslint

JSLint and Mocha-Tests


I use JSLint and configure a header in each file:

/*global Buffer: false, clearInterval: false, clearTimeout: false, console: false, exports: false, global: false, module: false, process: false, querystring: false, require: false, setInterval: false, setTimeout: false, __filename: false, __dirname: false, describe: false, it: false, before: false, after: false */

Everything works fine and my jenkins gets happy, but i get a warning for my tests.

Expected an assignment or function call and instead saw an expression.

for every expect line

 expect(Module).to.be.ok; 

How can i get rid of it?


Solution

  • two options:

    expect(Module).to.be.ok();
    

    or:

    /*jshint expr: true*/