How to use the @hapi/code.settings function in @hapi/code

To help you get started, we’ve selected a few @hapi/code examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hapijs / eslint-plugin-hapi / test / index.js View on Github external
'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();
github hapijs / eslint-config-hapi / test / index.js View on Github external
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', () => {

@hapi/code

assertion library

BSD-3-Clause
Latest version published 2 years ago

Package Health Score

59 / 100
Full package analysis

Popular @hapi/code functions