Skip to content

Commit ad2ae82

Browse files
committed
test(nx-plugin-e2e): fix missing Code PushUp CLI log (requires verbose level now)
1 parent 455043e commit ad2ae82

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

e2e/nx-plugin-e2e/tests/executor-cli.e2e.test.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { type Tree, updateProjectConfiguration } from '@nx/devkit';
22
import path from 'node:path';
33
import { readProjectConfiguration } from 'nx/src/generators/utils/project-configuration';
4-
import { afterAll, afterEach, beforeEach, expect, vi } from 'vitest';
4+
import { afterAll, afterEach, beforeEach, expect } from 'vitest';
55
import {
66
type AutorunCommandExecutorOptions,
77
generateCodePushupConfig,
@@ -17,7 +17,7 @@ import {
1717
removeColorCodes,
1818
teardownTestFolder,
1919
} from '@code-pushup/test-utils';
20-
import { executeProcess, readJsonFile } from '@code-pushup/utils';
20+
import { executeProcess, logger, readJsonFile } from '@code-pushup/utils';
2121
import { INLINE_PLUGIN } from '../mocks/inline-plugin.js';
2222

2323
async function addTargetToWorkspace(
@@ -62,15 +62,16 @@ describe('executor command', () => {
6262
Object.entries(process.env).filter(([k]) => k.startsWith('CP_')),
6363
);
6464

65-
/* eslint-disable functional/immutable-data, @typescript-eslint/no-dynamic-delete */
6665
beforeAll(() => {
6766
Object.entries(process.env)
6867
.filter(([k]) => k.startsWith('CP_'))
69-
.forEach(([k]) => delete process.env[k]);
68+
.forEach(([k]) => {
69+
// eslint-disable-next-line functional/immutable-data, @typescript-eslint/no-dynamic-delete
70+
delete process.env[k];
71+
});
7072
});
7173

7274
beforeEach(async () => {
73-
vi.unstubAllEnvs();
7475
tree = await generateWorkspaceAndProject(project);
7576
});
7677

@@ -79,9 +80,11 @@ describe('executor command', () => {
7980
});
8081

8182
afterAll(() => {
82-
Object.entries(processEnvCP).forEach(([k, v]) => (process.env[k] = v));
83+
Object.entries(processEnvCP).forEach(([k, v]) => {
84+
// eslint-disable-next-line functional/immutable-data
85+
process.env[k] = v;
86+
});
8387
});
84-
/* eslint-enable functional/immutable-data, @typescript-eslint/no-dynamic-delete */
8588

8689
it('should execute no specific command by default', async () => {
8790
const cwd = path.join(testFileDir, 'execute-default-command');
@@ -179,6 +182,7 @@ describe('executor command', () => {
179182
},
180183
},
181184
);
185+
logger.setVerbose(true);
182186

183187
const { stdout, code } = await executeProcess({
184188
command: 'npx',

0 commit comments

Comments
 (0)