testGenerator
{string|function(relativePath, errors), returns reporter output string
}: The function used to generate test modules. You can provide a custom function for your client side testing framework of choice.
Default: null
If you provide a string
one of the predefined test generators is used. Currently supported are qunit
and mocha
.
Example usage:
var path = require('path');
function testGenerator(relativePath, errors) {
return "module('" + path.dirname(relativePath) + "');\n";
"test('" + relativePath + "' should pass ESLint', function() {\n" +
" ok(" + passed + ", '" + moduleName + " should pass ESLint." + (errors ? "\\n" + errors : '') + "');\n" +
"});\n";
};
return eslint(inputNode, {
options: {
configFile: this.jshintrc.app + '/eslint.json',
rulesdir: this.jshintrc.app
},
testGenerator: testGenerator
});