Skip to content

Commit 5b79643

Browse files
author
John Doe
committed
refactor: adjust logic
1 parent a94e27d commit 5b79643

File tree

9 files changed

+22
-31
lines changed

9 files changed

+22
-31
lines changed

e2e/cli-e2e/tests/collect.e2e.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ import { afterEach, beforeAll, describe, expect, it } from 'vitest';
44
import { nxTargetProject } from '@code-pushup/test-nx-utils';
55
import {
66
E2E_ENVIRONMENTS_DIR,
7-
NX_IGNORED_FILES_TO_RESTORE,
87
TEST_OUTPUT_DIR,
9-
restoreRenamedFiles,
8+
restoreNxIgnoredFiles,
109
teardownTestFolder,
1110
} from '@code-pushup/test-utils';
1211
import {
@@ -38,7 +37,7 @@ describe('CLI collect', () => {
3837

3938
beforeAll(async () => {
4039
await cp(fixtureDummyDir, dummyDir, { recursive: true });
41-
await restoreRenamedFiles(dummyDir, NX_IGNORED_FILES_TO_RESTORE);
40+
await restoreNxIgnoredFiles(dummyDir);
4241
});
4342

4443
afterAll(async () => {

e2e/cli-e2e/tests/compare.e2e.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ import type { ReportsDiff } from '@code-pushup/models';
55
import { nxTargetProject } from '@code-pushup/test-nx-utils';
66
import {
77
E2E_ENVIRONMENTS_DIR,
8-
NX_IGNORED_FILES_TO_RESTORE,
98
TEST_OUTPUT_DIR,
10-
restoreRenamedFiles,
9+
restoreNxIgnoredFiles,
1110
teardownTestFolder,
1211
} from '@code-pushup/test-utils';
1312
import { executeProcess, readJsonFile, readTextFile } from '@code-pushup/utils';
@@ -32,7 +31,7 @@ describe('CLI compare', () => {
3231

3332
beforeAll(async () => {
3433
await cp(fixtureDummyDir, existingDir, { recursive: true });
35-
await restoreRenamedFiles(existingDir, NX_IGNORED_FILES_TO_RESTORE);
34+
await restoreNxIgnoredFiles(existingDir);
3635
});
3736

3837
afterAll(async () => {

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@ import { type Report, reportSchema } from '@code-pushup/models';
66
import { nxTargetProject } from '@code-pushup/test-nx-utils';
77
import {
88
E2E_ENVIRONMENTS_DIR,
9-
NX_IGNORED_FILES_TO_RESTORE,
109
TEST_OUTPUT_DIR,
1110
initGitRepo,
1211
omitVariableReportData,
13-
restoreRenamedFiles,
12+
restoreNxIgnoredFiles,
1413
teardownTestFolder,
1514
} from '@code-pushup/test-utils';
1615
import { executeProcess, readJsonFile } from '@code-pushup/utils';
@@ -26,7 +25,7 @@ describe('PLUGIN collect report with coverage-plugin NPM package', () => {
2625

2726
beforeAll(async () => {
2827
await cp(fixtureDir, testFileDir, { recursive: true });
29-
await restoreRenamedFiles(testFileDir, NX_IGNORED_FILES_TO_RESTORE);
28+
await restoreNxIgnoredFiles(testFileDir);
3029
await initGitRepo(simpleGit, { baseDir: basicDir });
3130
await initGitRepo(simpleGit, { baseDir: existingDir });
3231
});

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ import { type Report, reportSchema } from '@code-pushup/models';
55
import { nxTargetProject } from '@code-pushup/test-nx-utils';
66
import {
77
E2E_ENVIRONMENTS_DIR,
8-
NX_IGNORED_FILES_TO_RESTORE,
98
TEST_OUTPUT_DIR,
109
omitVariableReportData,
11-
restoreRenamedFiles,
10+
restoreNxIgnoredFiles,
1211
teardownTestFolder,
1312
} from '@code-pushup/test-utils';
1413
import { executeProcess, readJsonFile } from '@code-pushup/utils';
@@ -41,13 +40,13 @@ describe('PLUGIN collect report with eslint-plugin NPM package', () => {
4140

4241
beforeAll(async () => {
4342
await cp(fixturesFlatConfigDir, flatConfigDir, { recursive: true });
43+
await restoreNxIgnoredFiles(flatConfigDir);
4444
await cp(fixturesLegacyConfigDir, legacyConfigDir, { recursive: true });
45+
await restoreNxIgnoredFiles(legacyConfigDir);
4546
await cp(fixturesArtifactsConfigDir, artifactsConfigDir, {
4647
recursive: true,
4748
});
48-
await restoreRenamedFiles(flatConfigDir, NX_IGNORED_FILES_TO_RESTORE);
49-
await restoreRenamedFiles(legacyConfigDir, NX_IGNORED_FILES_TO_RESTORE);
50-
await restoreRenamedFiles(artifactsConfigDir, NX_IGNORED_FILES_TO_RESTORE);
49+
await restoreNxIgnoredFiles(artifactsConfigDir);
5150
});
5251

5352
afterAll(async () => {

e2e/plugin-js-packages-e2e/tests/plugin-js-packages.e2e.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ import {
99
import { nxTargetProject } from '@code-pushup/test-nx-utils';
1010
import {
1111
E2E_ENVIRONMENTS_DIR,
12-
NX_IGNORED_FILES_TO_RESTORE,
1312
TEST_OUTPUT_DIR,
14-
restoreRenamedFiles,
13+
restoreNxIgnoredFiles,
1514
teardownTestFolder,
1615
} from '@code-pushup/test-utils';
1716
import { executeProcess, readJsonFile } from '@code-pushup/utils';
@@ -34,7 +33,7 @@ describe('plugin-js-packages', () => {
3433

3534
beforeAll(async () => {
3635
await cp(fixturesNPMDir, npmRepoDir, { recursive: true });
37-
await restoreRenamedFiles(npmRepoDir, NX_IGNORED_FILES_TO_RESTORE);
36+
await restoreNxIgnoredFiles(npmRepoDir);
3837
});
3938

4039
afterAll(async () => {

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@ import { type Report, reportSchema } from '@code-pushup/models';
66
import { nxTargetProject } from '@code-pushup/test-nx-utils';
77
import {
88
E2E_ENVIRONMENTS_DIR,
9-
NX_IGNORED_FILES_TO_RESTORE,
109
TEST_OUTPUT_DIR,
1110
initGitRepo,
1211
omitVariableReportData,
13-
restoreRenamedFiles,
12+
restoreNxIgnoredFiles,
1413
teardownTestFolder,
1514
} from '@code-pushup/test-utils';
1615
import { executeProcess, readJsonFile } from '@code-pushup/utils';
@@ -38,8 +37,8 @@ describe('PLUGIN collect report with jsdocs-plugin NPM package', () => {
3837
beforeAll(async () => {
3938
await cp(fixturesAngularDir, angularDir, { recursive: true });
4039
await cp(fixturesReactDir, reactDir, { recursive: true });
41-
await restoreRenamedFiles(angularDir, NX_IGNORED_FILES_TO_RESTORE);
42-
await restoreRenamedFiles(reactDir, NX_IGNORED_FILES_TO_RESTORE);
40+
await restoreNxIgnoredFiles(angularDir);
41+
await restoreNxIgnoredFiles(reactDir);
4342
await initGitRepo(simpleGit, { baseDir: angularDir });
4443
await initGitRepo(simpleGit, { baseDir: reactDir });
4544
});

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ import { type Report, reportSchema } from '@code-pushup/models';
55
import { nxTargetProject } from '@code-pushup/test-nx-utils';
66
import {
77
E2E_ENVIRONMENTS_DIR,
8-
NX_IGNORED_FILES_TO_RESTORE,
98
TEST_OUTPUT_DIR,
109
omitVariableReportData,
1110
removeColorCodes,
12-
restoreRenamedFiles,
11+
restoreNxIgnoredFiles,
1312
teardownTestFolder,
1413
} from '@code-pushup/test-utils';
1514
import { executeProcess, readJsonFile } from '@code-pushup/utils';
@@ -27,7 +26,7 @@ describe('PLUGIN collect report with lighthouse-plugin NPM package', () => {
2726

2827
beforeAll(async () => {
2928
await cp(fixturesDir, testFileDir, { recursive: true });
30-
await restoreRenamedFiles(testFileDir, NX_IGNORED_FILES_TO_RESTORE);
29+
await restoreNxIgnoredFiles(testFileDir);
3130
});
3231

3332
afterAll(async () => {

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@ import { type Report, reportSchema } from '@code-pushup/models';
55
import { nxTargetProject } from '@code-pushup/test-nx-utils';
66
import {
77
E2E_ENVIRONMENTS_DIR,
8-
NX_IGNORED_FILES_TO_RESTORE,
98
TEST_OUTPUT_DIR,
109
omitVariableReportData,
1110
osAgnosticAuditOutputs,
1211
osAgnosticPath,
13-
restoreRenamedFiles,
12+
restoreNxIgnoredFiles,
1413
teardownTestFolder,
1514
} from '@code-pushup/test-utils';
1615
import { executeProcess, readJsonFile } from '@code-pushup/utils';
@@ -52,7 +51,7 @@ describe('PLUGIN collect report with typescript-plugin NPM package', () => {
5251

5352
beforeAll(async () => {
5453
await cp(fixturesDir, envRoot, { recursive: true });
55-
await restoreRenamedFiles(envRoot, NX_IGNORED_FILES_TO_RESTORE);
54+
await restoreNxIgnoredFiles(envRoot);
5655
});
5756

5857
afterAll(async () => {

packages/ci/src/lib/run.int.test.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,9 @@ import {
2121
DEFAULT_PERSIST_SKIP_REPORT,
2222
} from '@code-pushup/models';
2323
import {
24-
NX_IGNORED_FILES_TO_RESTORE,
2524
cleanTestFolder,
2625
initGitRepo,
27-
restoreRenamedFiles,
26+
restoreNxIgnoredFiles,
2827
simulateGitFetch,
2928
teardownTestFolder,
3029
} from '@code-pushup/test-utils';
@@ -626,7 +625,7 @@ describe('runInCI', () => {
626625
beforeEach(async () => {
627626
const monorepoDir = path.join(fixturesDir, 'monorepos', tool);
628627
await cp(monorepoDir, workDir, { recursive: true });
629-
await restoreRenamedFiles(workDir, NX_IGNORED_FILES_TO_RESTORE);
628+
await restoreNxIgnoredFiles(workDir);
630629
await git.add('.');
631630
await git.commit(`Create packages in ${tool} monorepo`);
632631
setup?.();
@@ -1140,7 +1139,7 @@ describe('runInCI', () => {
11401139
beforeEach(async () => {
11411140
const monorepoDir = path.join(fixturesDir, 'monorepos', 'custom');
11421141
await cp(monorepoDir, workDir, { recursive: true });
1143-
await restoreRenamedFiles(workDir, NX_IGNORED_FILES_TO_RESTORE);
1142+
await restoreNxIgnoredFiles(workDir);
11441143
await git.add('.');
11451144
await git.commit('Create projects in monorepo');
11461145
});

0 commit comments

Comments
 (0)