Skip to content

Commit 5855d73

Browse files
authored
Fix test and bump AVA (#84)
1 parent c8d272b commit 5855d73

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"devDependencies": {
4848
"@typescript-eslint/eslint-plugin": "^7.0.2",
4949
"@typescript-eslint/parser": "^7.0.2",
50-
"ava": "^2.4.0",
50+
"ava": "^6.1.2",
5151
"eslint": "^8.56.0",
5252
"typescript": "^5.3.3"
5353
},

test/test.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import test from 'ava';
2-
import {ESLint} from 'eslint';
3-
import config from '../index.js';
1+
const test = require('ava');
2+
const {ESLint} = require('eslint');
3+
4+
const config = require('../index.js');
45

56
const hasRule = (errors, ruleId) => errors.some(error => error.ruleId === ruleId);
67

@@ -10,12 +11,13 @@ async function runEslint(string, config) {
1011
overrideConfig: config,
1112
});
1213

13-
const [firstResult] = await eslint.lintText(string, {filePath: '_x.ts'});
14+
const [firstResult] = await eslint.lintText(string, {filePath: 'test/_x.ts'});
1415

1516
return firstResult.messages;
1617
}
1718

18-
test.failing('main', async t => {
19+
test('main', async t => {
1920
const errors = await runEslint('const foo: number = 5;', config);
2021
t.true(hasRule(errors, '@typescript-eslint/no-inferrable-types'), JSON.stringify(errors));
22+
t.is(errors.length, 1);
2123
});

tsconfig.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
2+
"compilerOptions": {
3+
"strict": true,
4+
},
25
"include": [
36
"test"
47
]

0 commit comments

Comments
 (0)