@@ -24,7 +24,7 @@ it(`should refuse to download a package manager if the hash doesn't match`, asyn
2424
2525 await expect ( runCli ( cwd , [ `yarn` , `--version` ] ) ) . resolves . toMatchObject ( {
2626 exitCode : 1 ,
27- stderr : / M i s m a t c h h a s h e s / ,
27+ stderr : expect . stringContaining ( ` Mismatch hashes` ) ,
2828 stdout : `` ,
2929 } ) ;
3030 } ) ;
@@ -35,7 +35,7 @@ it(`should refuse to download a known package manager from a URL`, async () => {
3535 // Package managers known by Corepack cannot be loaded from a URL.
3636 await expect ( runCli ( cwd , [ `yarn@https://registry.npmjs.com/yarn/-/yarn-1.22.21.tgz` , `--version` ] ) ) . resolves . toMatchObject ( {
3737 exitCode : 1 ,
38- stderr : / I l l e g a l u s e o f U R L f o r k n o w n p a c k a g e m a n a g e r / ,
38+ stderr : expect . stringContaining ( ` Illegal use of URL for known package manager` ) ,
3939 stdout : `` ,
4040 } ) ;
4141
@@ -57,7 +57,7 @@ it.fails(`should refuse to download a known package manager from a URL in packag
5757
5858 await expect ( runCli ( cwd , [ `yarn` , `--version` ] ) ) . resolves . toMatchObject ( {
5959 exitCode : 1 ,
60- stderr : / I l l e g a l u s e o f U R L f o r k n o w n p a c k a g e m a n a g e r / ,
60+ stderr : expect . stringContaining ( ` Illegal use of URL for known package manager` ) ,
6161 stdout : `` ,
6262 } ) ;
6363
@@ -82,7 +82,7 @@ it(`should require a version to be specified`, async () => {
8282
8383 await expect ( runCli ( cwd , [ `yarn` , `--version` ] ) ) . resolves . toMatchObject ( {
8484 exitCode : 1 ,
85- stderr : / e x p e c t e d a s e m v e r v e r s i o n / ,
85+ stderr : `No version specified for yarn in "packageManager" of package.json\n` ,
8686 stdout : `` ,
8787 } ) ;
8888
@@ -92,7 +92,7 @@ it(`should require a version to be specified`, async () => {
9292
9393 await expect ( runCli ( cwd , [ `yarn` , `--version` ] ) ) . resolves . toMatchObject ( {
9494 exitCode : 1 ,
95- stderr : / e x p e c t e d a s e m v e r v e r s i o n / ,
95+ stderr : expect . stringContaining ( ` expected a semver version` ) ,
9696 stdout : `` ,
9797 } ) ;
9898
@@ -102,7 +102,7 @@ it(`should require a version to be specified`, async () => {
102102
103103 await expect ( runCli ( cwd , [ `yarn` , `--version` ] ) ) . resolves . toMatchObject ( {
104104 exitCode : 1 ,
105- stderr : / e x p e c t e d a s e m v e r v e r s i o n / ,
105+ stderr : expect . stringContaining ( ` expected a semver version` ) ,
106106 stdout : `` ,
107107 } ) ;
108108 } ) ;
@@ -272,7 +272,7 @@ it(`shouldn't allow using regular Yarn commands on npm-configured projects`, asy
272272
273273 await expect ( runCli ( cwd , [ `yarn` , `--version` ] ) ) . resolves . toMatchObject ( {
274274 exitCode : 1 ,
275- stderr : / T h i s p r o j e c t i s c o n f i g u r e d t o u s e n p m / ,
275+ stderr : expect . stringContaining ( ` This project is configured to use npm` ) ,
276276 } ) ;
277277 } ) ;
278278} ) ;
@@ -473,7 +473,7 @@ it(`should support disabling the network accesses from the environment`, async (
473473
474474 await expect ( runCli ( cwd , [ `yarn` , `--version` ] ) ) . resolves . toMatchObject ( {
475475 stdout : `` ,
476- stderr : / N e t w o r k a c c e s s d i s a b l e d b y t h e e n v i r o n m e n t / ,
476+ stderr : expect . stringContaining ( ` Network access disabled by the environment` ) ,
477477 exitCode : 1 ,
478478 } ) ;
479479 } ) ;
@@ -845,8 +845,8 @@ it(`should download yarn classic from custom registry`, async () => {
845845 process . env . COREPACK_ENABLE_DOWNLOAD_PROMPT = `1` ;
846846 await expect ( runCli ( cwd , [ `yarn` , `--version` ] ) ) . resolves . toMatchObject ( {
847847 exitCode : 0 ,
848- stdout : / ^ 1 \. \d + \. \d + \r ? \n $ / ,
849- stderr : / ^ ! C o r e p a c k i s a b o u t t o d o w n l o a d h t t p s : \/ \/ r e g i s t r y \. n p m m i r r o r \. c o m \/ y a r n \/ - \/ y a r n - 1 \. \d + \. \d + \. t g z \r ? \n $ / ,
848+ stdout : expect . stringMatching ( / ^ 1 \. \d + \. \d + \r ? \n $ / ) ,
849+ stderr : expect . stringMatching ( / ^ ! C o r e p a c k i s a b o u t t o d o w n l o a d h t t p s : \/ \/ r e g i s t r y \. n p m m i r r o r \. c o m \/ y a r n \/ - \/ y a r n - 1 \. \d + \. \d + \. t g z \r ? \n $ / ) ,
850850 } ) ;
851851
852852 // Should keep working with cache
@@ -894,7 +894,7 @@ it(`should download latest pnpm from custom registry`, async () => {
894894 await expect ( runCli ( cwd , [ `pnpm` , `--version` ] , true ) ) . resolves . toMatchObject ( {
895895 exitCode : 0 ,
896896 stdout : `pnpm: Hello from custom registry\n` ,
897- stderr : / ^ ! T h e l o c a l p r o j e c t d o e s n ' t d e f i n e a ' p a c k a g e M a n a g e r ' f i e l d \ . C o r e p a c k w i l l n o w a d d o n e r e f e r e n c i n g p n p m @ 1 \ .9 9 9 8 \ .9 9 9 9 @ s h a 1 \. / ,
897+ stderr : expect . stringContaining ( ` ! The local project doesn't define a 'packageManager' field. Corepack will now add one referencing pnpm@1.9998.9999+ sha1.` ) ,
898898 } ) ;
899899
900900 // Should keep working with cache
@@ -1027,12 +1027,12 @@ describe(`handle integrity checks`, () => {
10271027 await xfs . mktempPromise ( async cwd => {
10281028 await expect ( runCli ( cwd , [ `pnpm@1.x` , `--version` ] , true ) ) . resolves . toMatchObject ( {
10291029 exitCode : 1 ,
1030- stderr : / S i g n a t u r e d o e s n o t m a t c h / ,
1030+ stderr : expect . stringContaining ( ` Signature does not match` ) ,
10311031 stdout : `` ,
10321032 } ) ;
1033- await expect ( runCli ( cwd , [ `yarn@stable ` , `--version` ] , true ) ) . resolves . toMatchObject ( {
1033+ await expect ( runCli ( cwd , [ `pnpm@latest ` , `--version` ] , true ) ) . resolves . toMatchObject ( {
10341034 exitCode : 1 ,
1035- stderr : / S i g n a t u r e d o e s n o t m a t c h / ,
1035+ stderr : expect . stringContaining ( ` Signature does not match` ) ,
10361036 stdout : `` ,
10371037 } ) ;
10381038 } ) ;
0 commit comments