11import { type Tree , updateProjectConfiguration } from '@nx/devkit' ;
22import path from 'node:path' ;
33import { 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' ;
55import {
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' ;
2121import { INLINE_PLUGIN } from '../mocks/inline-plugin.js' ;
2222
2323async 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