eslint-test-generator
Will create test scripts based on eslint output. Basically developers can't ignore linting if it's integrated into ci. eslint-test-generator
out of the box currently supports:
mocha
qunit
But can be easily extended by passing custom handlebars
templates.
Usage
Example
The following is an example of how to use eslint-test-generator
with Mocha:
; const output = ; console; // generated JS source for tests using mocha
When the above is done src
and test
directories will be linted by eslint
and the output would look something like this:
;
API Documentation
The following options can be passed to eslint-test-generator
:
template
- Can be one of three things. A path to ahandlebars
template file or ahandlebars
template string or one of the following values:'mocha'
'qunit'
paths
- Either a glob String or Array an array of globs. eg:src/
['src/filesToLint/**.js', 'test/'']
- etc.
maxWarnings
- Optional (default: -1), equivalent to--max-warnings
on eslint's CLI.-1
means there is no maximum.
License
MIT, see LICENSE.md for details.