@@ -18,6 +18,8 @@ const { ConsoleLogger } = require('../../src/profiling/loggers/console')
1818
1919const samplingContextsAvailable = process . platform !== 'win32'
2020const oomMonitoringSupported = process . platform !== 'win32'
21+ const isAtLeast24 = satisfies ( process . versions . node , '>=24.0.0' )
22+ const zstdOrGzip = isAtLeast24 ? 'zstd' : 'gzip'
2123
2224describe ( 'config' , ( ) => {
2325 let Config
@@ -59,7 +61,7 @@ describe('config', () => {
5961 assert . strictEqual ( config . profilers [ 1 ] . codeHotspotsEnabled ( ) , samplingContextsAvailable )
6062 assert . strictEqual ( config . v8ProfilerBugWorkaroundEnabled , true )
6163 assert . strictEqual ( config . cpuProfilingEnabled , samplingContextsAvailable )
62- assert . strictEqual ( config . uploadCompression . method , 'gzip' )
64+ assert . strictEqual ( config . uploadCompression . method , zstdOrGzip )
6365 assert . strictEqual ( config . uploadCompression . level , undefined )
6466 } )
6567
@@ -509,7 +511,7 @@ describe('config', () => {
509511 }
510512
511513 describe ( 'async context' , ( ) => {
512- const isSupported = samplingContextsAvailable && satisfies ( process . versions . node , '>=24.0.0' )
514+ const isSupported = samplingContextsAvailable && isAtLeast24
513515 describe ( 'where supported' , ( ) => {
514516 it ( 'should be on by default' , function ( ) {
515517 if ( ! isSupported ) {
@@ -589,15 +591,15 @@ describe('config', () => {
589591 }
590592
591593 it ( 'should accept known methods' , ( ) => {
592- expectConfig ( undefined , 'gzip' , undefined )
594+ expectConfig ( undefined , zstdOrGzip , undefined )
593595 expectConfig ( 'off' , 'off' , undefined )
594- expectConfig ( 'on' , 'gzip' , undefined )
596+ expectConfig ( 'on' , zstdOrGzip , undefined )
595597 expectConfig ( 'gzip' , 'gzip' , undefined )
596598 expectConfig ( 'zstd' , 'zstd' , undefined )
597599 } )
598600
599601 it ( 'should reject unknown methods' , ( ) => {
600- expectConfig ( 'foo' , 'gzip' , undefined , 'Invalid profile upload compression method "foo". Will use "on".' )
602+ expectConfig ( 'foo' , zstdOrGzip , undefined , 'Invalid profile upload compression method "foo". Will use "on".' )
601603 } )
602604
603605 it ( 'should accept supported compression levels in methods that support levels' , ( ) => {
@@ -617,7 +619,7 @@ describe('config', () => {
617619
618620 it ( 'should reject compression levels in methods that do not support levels' , ( ) => {
619621 [ 'on' , 'off' ] . forEach ( ( method ) => {
620- const effectiveMethod = method === 'on' ? 'gzip' : method
622+ const effectiveMethod = method === 'on' ? zstdOrGzip : method
621623 expectConfig ( `${ method } -3` , effectiveMethod , undefined ,
622624 `Compression levels are not supported for "${ method } ".` )
623625 expectConfig ( `${ method } -foo` , effectiveMethod , undefined ,
0 commit comments