@@ -19,6 +19,8 @@ const { ConsoleLogger } = require('../../src/profiling/loggers/console')
1919
2020const samplingContextsAvailable = process . platform !== 'win32'
2121const oomMonitoringSupported = process . platform !== 'win32'
22+ const isAtLeast24 = satisfies ( process . versions . node , '>=24.0.0' )
23+ const zstdOrGzip = isAtLeast24 ? 'zstd' : 'gzip'
2224
2325describe ( 'config' , ( ) => {
2426 let Config
@@ -60,7 +62,7 @@ describe('config', () => {
6062 assert . strictEqual ( config . profilers [ 1 ] . codeHotspotsEnabled ( ) , samplingContextsAvailable )
6163 assert . strictEqual ( config . v8ProfilerBugWorkaroundEnabled , true )
6264 assert . strictEqual ( config . cpuProfilingEnabled , samplingContextsAvailable )
63- assert . strictEqual ( config . uploadCompression . method , 'gzip' )
65+ assert . strictEqual ( config . uploadCompression . method , zstdOrGzip )
6466 assert . strictEqual ( config . uploadCompression . level , undefined )
6567 } )
6668
@@ -510,7 +512,7 @@ describe('config', () => {
510512 }
511513
512514 describe ( 'async context' , ( ) => {
513- const isSupported = samplingContextsAvailable && satisfies ( process . versions . node , '>=24.0.0' )
515+ const isSupported = samplingContextsAvailable && isAtLeast24
514516 describe ( 'where supported' , ( ) => {
515517 it ( 'should be on by default' , function ( ) {
516518 if ( ! isSupported ) {
@@ -590,15 +592,15 @@ describe('config', () => {
590592 }
591593
592594 it ( 'should accept known methods' , ( ) => {
593- expectConfig ( undefined , 'gzip' , undefined )
595+ expectConfig ( undefined , zstdOrGzip , undefined )
594596 expectConfig ( 'off' , 'off' , undefined )
595- expectConfig ( 'on' , 'gzip' , undefined )
597+ expectConfig ( 'on' , zstdOrGzip , undefined )
596598 expectConfig ( 'gzip' , 'gzip' , undefined )
597599 expectConfig ( 'zstd' , 'zstd' , undefined )
598600 } )
599601
600602 it ( 'should reject unknown methods' , ( ) => {
601- expectConfig ( 'foo' , 'gzip' , undefined , 'Invalid profile upload compression method "foo". Will use "on".' )
603+ expectConfig ( 'foo' , zstdOrGzip , undefined , 'Invalid profile upload compression method "foo". Will use "on".' )
602604 } )
603605
604606 it ( 'should accept supported compression levels in methods that support levels' , ( ) => {
@@ -618,7 +620,7 @@ describe('config', () => {
618620
619621 it ( 'should reject compression levels in methods that do not support levels' , ( ) => {
620622 [ 'on' , 'off' ] . forEach ( ( method ) => {
621- const effectiveMethod = method === 'on' ? 'gzip' : method
623+ const effectiveMethod = method === 'on' ? zstdOrGzip : method
622624 expectConfig ( `${ method } -3` , effectiveMethod , undefined ,
623625 `Compression levels are not supported for "${ method } ".` )
624626 expectConfig ( `${ method } -foo` , effectiveMethod , undefined ,
0 commit comments