Skip to content

Commit 458b1ec

Browse files
authored
Fix integration test (#340)
1 parent 8813033 commit 458b1ec

File tree

4 files changed

+43
-33
lines changed

4 files changed

+43
-33
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,12 @@ jobs:
2323
- run: npm test
2424
- uses: codecov/codecov-action@v2
2525

26-
# FIXME: https://github.com/avajs/eslint-plugin-ava/issues/333
27-
# integration:
28-
# name: Integration tests
29-
# runs-on: ubuntu-latest
30-
# steps:
31-
# - uses: actions/checkout@v2
32-
# - uses: actions/setup-node@v2
33-
# - run: npm install --no-audit
34-
# - run: npm run integration
35-
# - uses: codecov/codecov-action@v2
26+
integration:
27+
name: Integration tests
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v2
31+
- uses: actions/setup-node@v2
32+
- run: npm install --no-audit
33+
- run: npm run integration
34+
- uses: codecov/codecov-action@v2
Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
1+
'use strict';
2+
13
module.exports = {
4+
root: true,
25
parser: '@babel/eslint-parser',
36
parserOptions: {
4-
ecmaFeatures: {
5-
jsx: true,
7+
requireConfigFile: false,
8+
babelOptions: {
9+
babelrc: false,
10+
configFile: false,
611
},
712
},
813
plugins: [
914
'ava',
1015
],
1116
extends: 'plugin:ava/recommended',
17+
overrides: [
18+
{
19+
files: ['*.ts'],
20+
parser: '@typescript-eslint/parser',
21+
},
22+
],
1223
};
Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
{
2-
"name": "eslint-config-ava-tester",
3-
"dependencies": {
4-
"@babel/eslint-parser": "^7.15.7",
5-
"@typescript-eslint/parser": "^4.31.1",
6-
"babel-eslint": "^10.1.0",
7-
"eslint": "^7.32.0",
8-
"eslint-plugin-ava": "file:../../..",
9-
"typescript": "^4.4.3"
10-
}
2+
"name": "eslint-config-ava-tester",
3+
"dependencies": {
4+
"@babel/eslint-parser": "^7.16.0",
5+
"@typescript-eslint/parser": "^5.3.0",
6+
"eslint": "^8.1.0",
7+
"eslint-plugin-ava": "file:../../..",
8+
"typescript": "^4.4.4"
9+
}
1110
}

test/integration/test.js

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,7 @@ const packages = new Map([
4040
['pretty-bytes', 'https://github.com/sindresorhus/pretty-bytes'],
4141
['normalize-url', 'https://github.com/sindresorhus/normalize-url'],
4242
['pageres', 'https://github.com/sindresorhus/pageres'],
43-
// Disabled for now: https://github.com/avajs/eslint-plugin-ava/runs/2044891483?check_suite_focus=true
44-
// ['got', 'https://github.com/sindresorhus/got']
45-
]);
46-
47-
const typescriptPackages = new Set([
48-
'pageres',
49-
'got',
50-
'p-queue',
43+
['got', 'https://github.com/sindresorhus/got'],
5144
]);
5245

5346
const cwd = path.join(__dirname, 'eslint-config-ava-tester');
@@ -63,10 +56,18 @@ const enrichErrors = (packageName, cliArgs, f) => async (...args) => {
6356
};
6457

6558
const makeEslintTask = (packageName, dest, extraArgs = []) => {
66-
const isTypescriptPackage = typescriptPackages.has(packageName);
67-
const typescriptArgs = isTypescriptPackage ? ['--parser', '@typescript-eslint/parser', '--ext', '.ts'] : [];
68-
69-
const args = ['eslint', '--format', 'json', '--config', path.join(cwd, 'index.js'), dest, ...typescriptArgs, ...extraArgs];
59+
const args = [
60+
'eslint',
61+
'--config',
62+
path.join(cwd, 'index.js'),
63+
'--no-eslintrc',
64+
'--ext',
65+
'.js,.ts',
66+
dest,
67+
'--format',
68+
'json',
69+
...extraArgs,
70+
];
7071

7172
return enrichErrors(packageName, args, async () => {
7273
let stdout;

0 commit comments

Comments
 (0)