@@ -55,28 +55,31 @@ describe('telemetry command', () => {
5555 } ) ;
5656
5757 describe ( 'environment variable handling' , ( ) => {
58- it ( 'should show DO_NOT_TRACK in status when set' , async ( ) => {
58+ it ( 'should show DISABLED when DO_NOT_TRACK is set' , async ( ) => {
59+ // Save and clear global test setup
60+ const originalCodegenDisabled = process . env . CODEGEN_TELEMETRY_DISABLED ;
61+ delete process . env . CODEGEN_TELEMETRY_DISABLED ;
62+
5963 process . env . DO_NOT_TRACK = '1' ;
6064
6165 const { stdout, error} = await runCommand ( 'telemetry status' ) ;
6266
6367 expect ( error ) . toBeUndefined ( ) ;
6468 expect ( stdout ) . toContain ( 'DISABLED' ) ;
65- expect ( stdout ) . toContain ( 'DO_NOT_TRACK=1' ) ;
6669
6770 delete process . env . DO_NOT_TRACK ;
71+ // Restore global test setup
72+ if ( originalCodegenDisabled ) {
73+ process . env . CODEGEN_TELEMETRY_DISABLED = originalCodegenDisabled ;
74+ }
6875 } ) ;
6976
70- it ( 'should show CODEGEN_TELEMETRY_DISABLED in status when set' , async ( ) => {
71- process . env . CODEGEN_TELEMETRY_DISABLED = '1' ;
72-
77+ it ( 'should show DISABLED when CODEGEN_TELEMETRY_DISABLED is set' , async ( ) => {
78+ // CODEGEN_TELEMETRY_DISABLED is already set by test setup
7379 const { stdout, error} = await runCommand ( 'telemetry status' ) ;
7480
7581 expect ( error ) . toBeUndefined ( ) ;
7682 expect ( stdout ) . toContain ( 'DISABLED' ) ;
77- expect ( stdout ) . toContain ( 'CODEGEN_TELEMETRY_DISABLED=1' ) ;
78-
79- delete process . env . CODEGEN_TELEMETRY_DISABLED ;
8083 } ) ;
8184 } ) ;
8285
0 commit comments