Skip to content

Commit 385f0e3

Browse files
committed
test(plugin-eslint-e2e): fix tests by separating fixtures from test env folder
1 parent 3334e3a commit 385f0e3

File tree

8 files changed

+15
-30
lines changed

8 files changed

+15
-30
lines changed

e2e/plugin-eslint-e2e/__test-env__/package.json

Lines changed: 0 additions & 17 deletions
This file was deleted.

e2e/plugin-eslint-e2e/__test-env__/project.json

Lines changed: 0 additions & 8 deletions
This file was deleted.
File renamed without changes.

e2e/plugin-eslint-e2e/__test-env__/code-pushup.config.ts renamed to e2e/plugin-eslint-e2e/mocks/fixtures/code-pushup.config.ts

File renamed without changes.
File renamed without changes.

e2e/plugin-eslint-e2e/project.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
},
1414
"nxv-e2e": {
1515
"options": {
16-
"environmentRoot": "e2e/plugin-eslint-e2e/__test-env__"
16+
"environmentRoot": "tmp/plugin-eslint-e2e/__test-env__"
1717
}
1818
},
1919
"nxv-env-setup": {
2020
"options": {
21-
"environmentRoot": "e2e/plugin-eslint-e2e/__test-env__"
21+
"environmentRoot": "tmp/plugin-eslint-e2e/__test-env__"
2222
}
2323
},
2424
"e2e": {

e2e/plugin-eslint-e2e/tests/__snapshots__/collect.e2e.test.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ exports[`collect report with eslint-plugin NPM package > should run ESLint plugi
4242
"message": "'unusedFn' is defined but never used.",
4343
"severity": "error",
4444
"source": {
45-
"file": "static-environments/eslint-e2e-env/src/index.js",
45+
"file": "tmp/plugin-eslint-e2e/__test-env__/src/index.js",
4646
"position": {
4747
"endColumn": 18,
4848
"endLine": 1,
@@ -68,7 +68,7 @@ exports[`collect report with eslint-plugin NPM package > should run ESLint plugi
6868
"message": "Unexpected console statement.",
6969
"severity": "warning",
7070
"source": {
71-
"file": "static-environments/eslint-e2e-env/src/index.js",
71+
"file": "tmp/plugin-eslint-e2e/__test-env__/src/index.js",
7272
"position": {
7373
"endColumn": 14,
7474
"endLine": 6,

e2e/plugin-eslint-e2e/tests/collect.e2e.test.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { cp, rm } from 'node:fs/promises';
12
import { join } from 'node:path';
23
import { afterEach } from 'vitest';
34
import { type Report, reportSchema } from '@code-pushup/models';
@@ -6,9 +7,18 @@ import { omitVariableReportData } from '@code-pushup/test-utils';
67
import { executeProcess, readJsonFile } from '@code-pushup/utils';
78

89
describe('collect report with eslint-plugin NPM package', () => {
9-
const envRoot = 'e2e/plugin-eslint-e2e/__test-env__';
10+
const fixturesDir = join('e2e', 'plugin-eslint-e2e', 'mocks', 'fixtures');
11+
const envRoot = join('tmp', 'plugin-eslint-e2e', '__test-env__');
1012
const outputDir = join(envRoot, '.code-pushup');
1113

14+
beforeAll(async () => {
15+
await cp(fixturesDir, envRoot, { recursive: true });
16+
});
17+
18+
afterAll(async () => {
19+
await rm(envRoot, { recursive: true, force: true });
20+
});
21+
1222
afterEach(async () => {
1323
await teardownTestFolder(outputDir);
1424
});

0 commit comments

Comments
 (0)