1'use strict'; 2 3const common = require('../common'); 4if (!common.hasCrypto) 5 common.skip('missing crypto'); 6common.skipIfEslintMissing(); 7 8const RuleTester = require('../../tools/node_modules/eslint').RuleTester; 9const rule = require('../../tools/eslint-rules/alphabetize-errors'); 10 11new RuleTester().run('alphabetize-errors', rule, { 12 valid: [ 13 ` 14 E('AAA', 'foo'); 15 E('BBB', 'bar'); 16 E('CCC', 'baz'); 17 `, 18 ], 19 invalid: [ 20 { 21 code: ` 22 E('BBB', 'bar'); 23 E('AAA', 'foo'); 24 E('CCC', 'baz'); 25 `, 26 errors: [{ message: 'Out of ASCIIbetical order - BBB >= AAA', line: 3 }] 27 }, 28 ] 29}); 30