• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2
3const common = require('../common');
4if (!common.hasCrypto)
5  common.skip('missing crypto');
6
7common.skipIfEslintMissing();
8
9const RuleTester = require('../../tools/node_modules/eslint').RuleTester;
10const rule = require('../../tools/eslint-rules/non-ascii-character');
11
12new RuleTester().run('non-ascii-characters', rule, {
13  valid: [
14    {
15      code: 'console.log("fhqwhgads")',
16      options: []
17    },
18  ],
19  invalid: [
20    {
21      code: 'console.log("μ")',
22      options: [],
23      errors: [{ message: "Non-ASCII character 'μ' detected." }],
24    },
25  ]
26});
27