@@ -95,7 +95,7 @@ for (const [name, version] of testedPackageManagers) {
95
95
await expect ( runCli ( cwd , [ name , `--version` ] ) ) . resolves . toMatchObject ( {
96
96
exitCode : 0 ,
97
97
stderr : `` ,
98
- stdout : ` ${ version . split ( `+` , 1 ) [ 0 ] } \n` ,
98
+ stdout : expect . stringMatching ( new RegExp ( version . split ( `+` , 1 ) [ 0 ] ) ) ,
99
99
} ) ;
100
100
} ) ;
101
101
} ) ;
@@ -223,7 +223,7 @@ it(`should use the pinned version when local projects don't list any spec`, asyn
223
223
} ) ;
224
224
225
225
await expect ( runCli ( cwd , [ `cnpm` , `--version` ] ) ) . resolves . toMatchObject ( {
226
- stdout : ` ${ config . definitions . cnpm . default . split ( `+` , 1 ) [ 0 ] } \n` ,
226
+ stdout : expect . stringMatching ( new RegExp ( config . definitions . cnpm . default . split ( `+` , 1 ) [ 0 ] ) ) ,
227
227
stderr : `` ,
228
228
exitCode : 0 ,
229
229
} ) ;
@@ -314,7 +314,7 @@ it(`should refuse to run a different package manager within a configured project
314
314
} ) ;
315
315
316
316
await expect ( runCli ( cwd , [ `cnpm` , `--version` ] ) ) . resolves . toMatchObject ( {
317
- stdout : `Usage Error: This project is configured to use yarn\n\n$ cnpm...\n` ,
317
+ stdout : `Usage Error: This project is configured to use yarn\n\n$ cnpm ...\n` ,
318
318
exitCode : 1 ,
319
319
} ) ;
320
320
@@ -364,7 +364,7 @@ it(`should always use fallback version when project spec env is disabled`, async
364
364
exitCode : 0 ,
365
365
} ) ;
366
366
await expect ( runCli ( cwd , [ `cnpm` , `--version` ] ) ) . resolves . toMatchObject ( {
367
- stdout : ` ${ config . definitions . cnpm . default . split ( `+` , 1 ) [ 0 ] } \n` ,
367
+ stdout : expect . stringMatching ( new RegExp ( config . definitions . cnpm . default . split ( `+` , 1 ) [ 0 ] ) ) ,
368
368
stderr : `` ,
369
369
exitCode : 0 ,
370
370
} ) ;
@@ -401,7 +401,7 @@ it(`should allow to call "corepack install -g --all" to prepare all package mana
401
401
} ) ;
402
402
403
403
await expect ( runCli ( cwd , [ `cnpm` , `--version` ] ) ) . resolves . toMatchObject ( {
404
- stdout : ` ${ config . definitions . cnpm . default . split ( `+` , 1 ) [ 0 ] } \n` ,
404
+ stdout : expect . stringMatching ( new RegExp ( config . definitions . cnpm . default . split ( `+` , 1 ) [ 0 ] ) ) ,
405
405
stderr : `` ,
406
406
exitCode : 0 ,
407
407
} ) ;
@@ -552,7 +552,7 @@ it(`should support hydrating multiple package managers from cached archives`, as
552
552
} ) ;
553
553
554
554
await expect ( runCli ( cwd , [ `cnpm` , `--version` ] ) ) . resolves . toMatchObject ( {
555
- stdout : ` cnpm@9.3.1` ,
555
+ stdout : expect . stringMatching ( / c n p m @ 9 \. 3 \. 1 / ) ,
556
556
stderr : `` ,
557
557
exitCode : 0 ,
558
558
} ) ;
0 commit comments