@@ -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 : expect . stringMatching ( new RegExp ( version . split ( `+` , 1 ) [ 0 ] ) ) ,
98
+ stdout : expect . stringContaining ( 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 : expect . stringMatching ( new RegExp ( config . definitions . cnpm . default . split ( `+ ` , 1 ) [ 0 ] ) ) ,
226
+ stdout : expect . stringContaining ( `cnpm@ ${ config . definitions . cnpm . default . split ( ` + ` , 1 ) [ 0 ] } ` ) ,
227
227
stderr : `` ,
228
228
exitCode : 0 ,
229
229
} ) ;
@@ -333,7 +333,7 @@ it(`should refuse to run a different package manager within a configured project
333
333
exitCode : 0 ,
334
334
} ) ;
335
335
await expect ( runCli ( cwd , [ `cnpm` , `--version` ] ) ) . resolves . toMatchObject ( {
336
- stdout : expect . stringMatching ( new RegExp ( config . definitions . cnpm . default . split ( `+ ` , 1 ) [ 0 ] ) ) ,
336
+ stdout : expect . stringContaining ( `cnpm@ ${ config . definitions . cnpm . default . split ( ` + ` , 1 ) [ 0 ] } ` ) ,
337
337
stderr : `` ,
338
338
exitCode : 0 ,
339
339
} ) ;
@@ -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 : expect . stringMatching ( new RegExp ( config . definitions . cnpm . default . split ( `+ ` , 1 ) [ 0 ] ) ) ,
367
+ stdout : expect . stringContaining ( `cnpm@ ${ 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 : expect . stringMatching ( new RegExp ( config . definitions . cnpm . default . split ( `+ ` , 1 ) [ 0 ] ) ) ,
404
+ stdout : expect . stringContaining ( `cnpm@ ${ 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 : expect . stringMatching ( / c n p m @ 9 \. 3 \. 2 / ) ,
555
+ stdout : expect . stringContaining ( ` cnpm@9.3.2` ) ,
556
556
stderr : `` ,
557
557
exitCode : 0 ,
558
558
} ) ;
0 commit comments