@@ -95,7 +95,7 @@ for (const [name, version] of testedPackageManagers) {
9595 await expect ( runCli ( cwd , [ name , `--version` ] ) ) . resolves . toMatchObject ( {
9696 exitCode : 0 ,
9797 stderr : `` ,
98- stdout : expect . stringMatching ( new RegExp ( version . split ( `+` , 1 ) [ 0 ] ) ) ,
98+ stdout : expect . stringContaining ( version . split ( `+` , 1 ) [ 0 ] ) ,
9999 } ) ;
100100 } ) ;
101101 } ) ;
@@ -223,7 +223,7 @@ it(`should use the pinned version when local projects don't list any spec`, asyn
223223 } ) ;
224224
225225 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 ] } ` ) ,
227227 stderr : `` ,
228228 exitCode : 0 ,
229229 } ) ;
@@ -333,7 +333,7 @@ it(`should refuse to run a different package manager within a configured project
333333 exitCode : 0 ,
334334 } ) ;
335335 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 ] } ` ) ,
337337 stderr : `` ,
338338 exitCode : 0 ,
339339 } ) ;
@@ -364,7 +364,7 @@ it(`should always use fallback version when project spec env is disabled`, async
364364 exitCode : 0 ,
365365 } ) ;
366366 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 ] } ` ) ,
368368 stderr : `` ,
369369 exitCode : 0 ,
370370 } ) ;
@@ -401,7 +401,7 @@ it(`should allow to call "corepack install -g --all" to prepare all package mana
401401 } ) ;
402402
403403 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 ] } ` ) ,
405405 stderr : `` ,
406406 exitCode : 0 ,
407407 } ) ;
@@ -552,7 +552,7 @@ it(`should support hydrating multiple package managers from cached archives`, as
552552 } ) ;
553553
554554 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` ) ,
556556 stderr : `` ,
557557 exitCode : 0 ,
558558 } ) ;
0 commit comments