xref: /third_party/node/test/parallel/test-eslint-non-ascii-character.js (revision 1cb0ef41)
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/parallel/
11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ci
31cb0ef41Sopenharmony_ciconst common = require('../common');
41cb0ef41Sopenharmony_ciif ((!common.hasCrypto) || (!common.hasIntl)) {
51cb0ef41Sopenharmony_ci  common.skip('ESLint tests require crypto and Intl');
61cb0ef41Sopenharmony_ci}
71cb0ef41Sopenharmony_ci
81cb0ef41Sopenharmony_cicommon.skipIfEslintMissing();
91cb0ef41Sopenharmony_ci
101cb0ef41Sopenharmony_ciconst RuleTester = require('../../tools/node_modules/eslint').RuleTester;
111cb0ef41Sopenharmony_ciconst rule = require('../../tools/eslint-rules/non-ascii-character');
121cb0ef41Sopenharmony_ci
131cb0ef41Sopenharmony_cinew RuleTester().run('non-ascii-characters', rule, {
141cb0ef41Sopenharmony_ci  valid: [
151cb0ef41Sopenharmony_ci    {
161cb0ef41Sopenharmony_ci      code: 'console.log("fhqwhgads")',
171cb0ef41Sopenharmony_ci      options: []
181cb0ef41Sopenharmony_ci    },
191cb0ef41Sopenharmony_ci  ],
201cb0ef41Sopenharmony_ci  invalid: [
211cb0ef41Sopenharmony_ci    {
221cb0ef41Sopenharmony_ci      code: 'console.log("μ")',
231cb0ef41Sopenharmony_ci      options: [],
241cb0ef41Sopenharmony_ci      errors: [{ message: "Non-ASCII character 'μ' detected." }],
251cb0ef41Sopenharmony_ci    },
261cb0ef41Sopenharmony_ci  ]
271cb0ef41Sopenharmony_ci});
28

Indexes created Thu Nov 07 10:32:03 CST 2024