mirror of
https://github.com/nodejs/node.git
synced 2025-05-03 01:31:27 +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>
33 lines
724 B
JavaScript
33 lines
724 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/no-unescaped-regexp-dot');
|
|
|
|
new RuleTester().run('no-unescaped-regexp-dot', rule, {
|
|
valid: [
|
|
'/foo/',
|
|
String.raw`/foo\./`,
|
|
'/.+/',
|
|
'/.*/',
|
|
'/.?/',
|
|
'/.{5}/',
|
|
String.raw`/\\\./`,
|
|
],
|
|
invalid: [
|
|
{
|
|
code: '/./',
|
|
errors: [{ message: 'Unescaped dot character in regular expression' }]
|
|
},
|
|
{
|
|
code: String.raw`/\\./`,
|
|
errors: [{ message: 'Unescaped dot character in regular expression' }]
|
|
},
|
|
]
|
|
});
|