Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'use strict';
const Code = require('@hapi/code');
const Lab = require('@hapi/lab');
const Plugin = require('..');
const internals = {};
const { describe, it } = exports.lab = Lab.script();
const expect = Code.expect;
Code.settings.truncateMessages = false;
describe('ESLint Plugin', () => {
it('exposes all expected rules', () => {
expect(Plugin.rules).to.exist();
expect(Plugin.rules).to.be.an.object();
const rules = Object.keys(Plugin.rules);
expect(rules.length).to.equal(5);
expect(rules.includes('capitalize-modules')).to.be.true();
expect(rules.includes('for-loop')).to.be.true();
expect(rules.includes('no-var')).to.be.true();
expect(rules.includes('scope-start')).to.be.true();
const Path = require('path');
const Code = require('@hapi/code');
const ESLint = require('eslint');
const Lab = require('@hapi/lab');
const Config = require('..');
const internals = {};
const { describe, it } = exports.lab = Lab.script();
const expect = Code.expect;
Code.settings.truncateMessages = false;
internals.lintFile = function (file) {
const cli = new ESLint.CLIEngine({
useEslintrc: false,
baseConfig: Config
});
const data = Fs.readFileSync(Path.join(__dirname, file), 'utf8');
return cli.executeOnText(data);
};
describe('eslint-config', () => {