mirror of
https://github.com/nodejs/node.git
synced 2025-05-02 14:56:19 +00:00

Make changes so that tests will pass when the comma-dangle settings applied to the rest of the code base are also applied to tests. PR-URL: https://github.com/nodejs/node/pull/37930 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
28 lines
668 B
JavaScript
28 lines
668 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
if (!common.hasCrypto)
|
|
common.skip('missing crypto');
|
|
|
|
common.skipIfEslintMissing();
|
|
|
|
const RuleTester = require('../../tools/node_modules/eslint').RuleTester;
|
|
const rule = require('../../tools/eslint-rules/require-common-first');
|
|
|
|
new RuleTester().run('require-common-first', rule, {
|
|
valid: [
|
|
{
|
|
code: 'require("common")\n' +
|
|
'require("assert")'
|
|
},
|
|
],
|
|
invalid: [
|
|
{
|
|
code: 'require("assert")\n' +
|
|
'require("common")',
|
|
errors: [{ message: 'Mandatory module "common" must be loaded ' +
|
|
'before any other modules.' }]
|
|
},
|
|
]
|
|
});
|