Security News
NVD Backlog Tops 20,000 CVEs Awaiting Analysis as NIST Prepares System Updates
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
eslint-test-generator
Advanced tools
Will create test scripts based on eslint output. Basically developers can't ignore linting if it's integrated into ci
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.
The following is an example of how to use eslint-test-generator
with Mocha:
import generator from 'eslint-test-generator';
const output = generator({
template: 'mocha',
paths: [
'src/',
'test/**/*.js'
],
maxWarnings: 0
});
console.log(output); // 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:
suite('lint all files', () => {
test('src/a.js should lint', () => {
assert.ok(true, 'test/test-src-to-lint/some-warnings.js should pass lint.');
});
test('src/b.js should lint', () => {
assert.ok(false, 'test/test-src-to-lint/some-errors.js should pass lint.\n1:4 - Parsing error: Unexpected token ');
});
});
The following options can be passed to eslint-test-generator
:
template
- Can be one of three things. A path to a handlebars
template file or a handlebars
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/'']
maxWarnings
- Optional (default: -1), equivalent to --max-warnings
on
eslint's CLI. -1
means there is no maximum.MIT, see LICENSE.md for details.
FAQs
Will create test scripts based on eslint output. Basically developers can't ignore linting if it's integrated into ci
We found that eslint-test-generator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.