summaryrefslogtreecommitdiff
path: root/test/parallel/test-eslint-non-ascii-character.js
blob: 0b4a09f813431b7b0249487ce3d7c9d30e134d8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
'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/non-ascii-character');

new RuleTester().run('non-ascii-characters', rule, {
  valid: [
    {
      code: 'console.log("fhqwhgads")',
      options: []
    },
  ],
  invalid: [
    {
      code: 'console.log("μ")',
      options: [],
      errors: [{ message: "Non-ASCII character 'μ' detected." }],
    },
  ]
});