1- import path from 'node:path' ;
21import { performance } from 'node:perf_hooks' ;
32import { beforeEach , describe , expect , it , vi } from 'vitest' ;
43import { awaitObserverCallbackAndFlush } from '@code-pushup/test-utils' ;
@@ -40,7 +39,7 @@ const resetEnv = () => {
4039 delete process . env . DEBUG ;
4140 // eslint-disable-next-line functional/immutable-data
4241 delete process . env . CP_PROFILING ;
43- // eslint-disable-next-line functional/immutable-data
42+ // eslint-disable-next-line functional/immutable-data, @typescript-eslint/no-dynamic-delete
4443 delete process . env [ PROFILER_SHARDER_ID_ENV_VAR ] ;
4544} ;
4645
@@ -197,6 +196,7 @@ describe('NodejsProfiler', () => {
197196 expect ( profiler . stats . isSubscribed ) . toBe ( true ) ;
198197 } ) ;
199198
199+ // eslint-disable-next-line vitest/expect-expect
200200 it ( 'should initialize with sink closed when enabled is false' , ( ) => {
201201 const profiler = createProfiler ( {
202202 measureName : 'init-disabled' ,
@@ -300,6 +300,7 @@ describe('NodejsProfiler', () => {
300300 expect ( profiler . state ) . toBe ( 'closed' ) ;
301301 } ) ;
302302
303+ // eslint-disable-next-line vitest/expect-expect
303304 it ( 'should maintain state invariant: running ⇒ sink open + observer subscribed' , ( ) => {
304305 const profiler = createProfiler ( {
305306 measureName : 'state-invariant' ,
@@ -584,6 +585,7 @@ describe('NodejsProfiler', () => {
584585 expect ( debugProfiler . debug ) . toBe ( true ) ;
585586 } ) ;
586587
588+ // eslint-disable-next-line vitest/expect-expect
587589 it ( 'should create transition marker when debug is enabled and transitioning to running' , ( ) => {
588590 // eslint-disable-next-line functional/immutable-data
589591 process . env . DEBUG = 'true' ;
@@ -598,19 +600,7 @@ describe('NodejsProfiler', () => {
598600 expectTransitionMarker ( 'debug:idle->running' ) ;
599601 } ) ;
600602
601- it ( 'should not create transition marker when transitioning from running to idle (profiler disabled)' , ( ) => {
602- // eslint-disable-next-line functional/immutable-data
603- process . env . DEBUG = 'true' ;
604- const profiler = createProfiler ( {
605- measureName : 'debug-no-transition-marker' ,
606- } ) ;
607-
608- performance . clearMarks ( ) ;
609- profiler . setEnabled ( false ) ;
610-
611- expectNoTransitionMarker ( 'running->idle' ) ;
612- } ) ;
613-
603+ // eslint-disable-next-line vitest/expect-expect
614604 it ( 'does not emit transition markers unless debug is enabled' , ( ) => {
615605 const profiler = createProfiler ( 'no-transition-markers' ) ;
616606
0 commit comments