Skip to content

Commit 459a99c

Browse files
committed
minor test tweaks
1 parent ac931aa commit 459a99c

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

test/api.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ import path from 'path';
22
import test from 'ava';
33
import fn from '../';
44

5-
function hasRule(results, ruleId) {
6-
return results[0].messages.some(x => x.ruleId === ruleId);
7-
}
5+
const hasRule = (results, ruleId) => results[0].messages.some(x => x.ruleId === ruleId);
86

97
test('.lintText()', t => {
108
const results = fn.lintText(`'use strict'\nconsole.log('unicorn');\n`).results;
@@ -50,16 +48,13 @@ test('.lintText() - extends support with `esnext` option', t => {
5048
});
5149

5250
test('always use the Babel parser so esnext syntax won\'t throw in normal mode', t => {
53-
// TODO: remove the `filename` option when https://github.com/sindresorhus/eslint-plugin-xo/issues/19 is fixed
54-
const results = fn.lintText('async function foo() {}\n\nfoo();\n', {filename: 'x'}).results;
51+
const results = fn.lintText('async function foo() {}\n\nfoo();\n').results;
5552
t.is(results[0].errorCount, 0);
5653
});
5754

5855
test('.lintText() - regression test for #71', t => {
59-
// TODO: remove the `filename` option when https://github.com/sindresorhus/eslint-plugin-xo/issues/19 is fixed
6056
const results = fn.lintText(`var foo = { key: 'value' };\nconsole.log(foo);\n`, {
61-
extends: path.join(__dirname, 'fixtures/extends.js'),
62-
filename: 'x'
57+
extends: path.join(__dirname, 'fixtures/extends.js')
6358
}).results;
6459
t.is(results[0].errorCount, 0, results[0]);
6560
});

0 commit comments

Comments
 (0)