@@ -17,6 +17,7 @@ it(`should refuse to download a package manager if the hash doesn't match`, asyn
17
17
18
18
await expect ( runCli ( cwd , [ `yarn` , `--version` ] ) ) . resolves . toMatchObject ( {
19
19
exitCode : 1 ,
20
+ stderr : `` ,
20
21
stdout : / M i s m a t c h h a s h e s / ,
21
22
} ) ;
22
23
} ) ;
@@ -52,6 +53,7 @@ for (const [name, version] of testedPackageManagers) {
52
53
53
54
await expect ( runCli ( cwd , [ name , `--version` ] ) ) . resolves . toMatchObject ( {
54
55
exitCode : 0 ,
56
+ stderr : `` ,
55
57
stdout : `${ version . split ( `+` , 1 ) [ 0 ] } \n` ,
56
58
} ) ;
57
59
} ) ;
@@ -77,11 +79,13 @@ it(`should ignore the packageManager field when found within a node_modules vend
77
79
78
80
await expect ( runCli ( ppath . join ( cwd , `node_modules/foo` as PortablePath ) , [ `yarn` , `--version` ] ) ) . resolves . toMatchObject ( {
79
81
exitCode : 0 ,
82
+ stderr : `` ,
80
83
stdout : `1.22.4\n` ,
81
84
} ) ;
82
85
83
86
await expect ( runCli ( ppath . join ( cwd , `node_modules/@foo/bar` as PortablePath ) , [ `yarn` , `--version` ] ) ) . resolves . toMatchObject ( {
84
87
exitCode : 0 ,
88
+ stderr : `` ,
85
89
stdout : `1.22.4\n` ,
86
90
} ) ;
87
91
} ) ;
@@ -101,6 +105,7 @@ it(`should use the closest matching packageManager field`, async () => {
101
105
102
106
await expect ( runCli ( ppath . join ( cwd , `foo` as PortablePath ) , [ `npm` , `--version` ] ) ) . resolves . toMatchObject ( {
103
107
exitCode : 0 ,
108
+ stderr : `` ,
104
109
stdout : `6.14.2\n` ,
105
110
} ) ;
106
111
} ) ;
@@ -127,6 +132,7 @@ it(`shouldn't allow using regular Yarn commands on npm-configured projects`, asy
127
132
128
133
await expect ( runCli ( cwd , [ `yarn` , `--version` ] ) ) . resolves . toMatchObject ( {
129
134
exitCode : 1 ,
135
+ stderr : `` ,
130
136
} ) ;
131
137
} ) ;
132
138
} ) ;
@@ -137,8 +143,9 @@ it(`should allow using transparent commands on npm-configured projects`, async (
137
143
packageManager : `npm@6.14.2` ,
138
144
} ) ;
139
145
140
- await expect ( runCli ( cwd , [ `yarn` , `dlx` , `cat@0.2.0` , __filename ] ) ) . resolves . toMatchObject ( {
146
+ await expect ( runCli ( cwd , [ `yarn` , `dlx` , `--help` ] ) ) . resolves . toMatchObject ( {
141
147
exitCode : 0 ,
148
+ stderr : `` ,
142
149
} ) ;
143
150
} ) ;
144
151
} ) ;
@@ -147,6 +154,7 @@ it(`should transparently use the preconfigured version when there is no local pr
147
154
await xfs . mktempPromise ( async cwd => {
148
155
await expect ( runCli ( cwd , [ `yarn` , `--version` ] ) ) . resolves . toMatchObject ( {
149
156
exitCode : 0 ,
157
+ stderr : `` ,
150
158
} ) ;
151
159
} ) ;
152
160
} ) ;
@@ -163,16 +171,19 @@ it(`should use the pinned version when local projects don't list any spec`, asyn
163
171
164
172
await expect ( runCli ( cwd , [ `yarn` , `--version` ] ) ) . resolves . toMatchObject ( {
165
173
stdout : `${ config . definitions . yarn . default . split ( `+` , 1 ) [ 0 ] } \n` ,
174
+ stderr : `` ,
166
175
exitCode : 0 ,
167
176
} ) ;
168
177
169
178
await expect ( runCli ( cwd , [ `pnpm` , `--version` ] ) ) . resolves . toMatchObject ( {
170
179
stdout : `${ config . definitions . pnpm . default . split ( `+` , 1 ) [ 0 ] } \n` ,
180
+ stderr : `` ,
171
181
exitCode : 0 ,
172
182
} ) ;
173
183
174
184
await expect ( runCli ( cwd , [ `npm` , `--version` ] ) ) . resolves . toMatchObject ( {
175
185
stdout : `${ config . definitions . npm . default . split ( `+` , 1 ) [ 0 ] } \n` ,
186
+ stderr : `` ,
176
187
exitCode : 0 ,
177
188
} ) ;
178
189
} ) ;
@@ -182,6 +193,7 @@ it(`should allow updating the pinned version using the "prepare" command`, async
182
193
await xfs . mktempPromise ( async cwd => {
183
194
await expect ( runCli ( cwd , [ `prepare` , `--activate` , `yarn@1.0.0` ] ) ) . resolves . toMatchObject ( {
184
195
exitCode : 0 ,
196
+ stderr : `` ,
185
197
} ) ;
186
198
187
199
await xfs . writeJsonPromise ( ppath . join ( cwd , `package.json` as Filename ) , {
@@ -190,6 +202,7 @@ it(`should allow updating the pinned version using the "prepare" command`, async
190
202
191
203
await expect ( runCli ( cwd , [ `yarn` , `--version` ] ) ) . resolves . toMatchObject ( {
192
204
stdout : `1.0.0\n` ,
205
+ stderr : `` ,
193
206
exitCode : 0 ,
194
207
} ) ;
195
208
} ) ;
@@ -203,6 +216,7 @@ it(`should allow to call "prepare" without arguments within a configured project
203
216
204
217
await expect ( runCli ( cwd , [ `prepare` , `--activate` ] ) ) . resolves . toMatchObject ( {
205
218
exitCode : 0 ,
219
+ stderr : `` ,
206
220
} ) ;
207
221
208
222
// Disable the network to make sure we don't succeed by accident
@@ -211,6 +225,7 @@ it(`should allow to call "prepare" without arguments within a configured project
211
225
try {
212
226
await expect ( runCli ( cwd , [ `yarn` , `--version` ] ) ) . resolves . toMatchObject ( {
213
227
stdout : `1.0.0\n` ,
228
+ stderr : `` ,
214
229
exitCode : 0 ,
215
230
} ) ;
216
231
} finally {
@@ -255,23 +270,27 @@ it(`should allow to call "prepare" with --all to prepare all package managers`,
255
270
256
271
await expect ( runCli ( cwd , [ `prepare` , `--all` ] ) ) . resolves . toMatchObject ( {
257
272
exitCode : 0 ,
273
+ stderr : `` ,
258
274
} ) ;
259
275
260
276
process . env . COREPACK_ENABLE_NETWORK = `0` ;
261
277
262
278
try {
263
279
await expect ( runCli ( cwd , [ `yarn` , `--version` ] ) ) . resolves . toMatchObject ( {
264
280
stdout : `${ config . definitions . yarn . default . split ( `+` , 1 ) [ 0 ] } \n` ,
281
+ stderr : `` ,
265
282
exitCode : 0 ,
266
283
} ) ;
267
284
268
285
await expect ( runCli ( cwd , [ `pnpm` , `--version` ] ) ) . resolves . toMatchObject ( {
269
286
stdout : `${ config . definitions . pnpm . default . split ( `+` , 1 ) [ 0 ] } \n` ,
287
+ stderr : `` ,
270
288
exitCode : 0 ,
271
289
} ) ;
272
290
273
291
await expect ( runCli ( cwd , [ `npm` , `--version` ] ) ) . resolves . toMatchObject ( {
274
292
stdout : `${ config . definitions . npm . default . split ( `+` , 1 ) [ 0 ] } \n` ,
293
+ stderr : `` ,
275
294
exitCode : 0 ,
276
295
} ) ;
277
296
} finally {
@@ -291,6 +310,7 @@ it(`should support disabling the network accesses from the environment`, async (
291
310
292
311
await expect ( runCli ( cwd , [ `yarn` , `--version` ] ) ) . resolves . toMatchObject ( {
293
312
stdout : expect . stringContaining ( `Network access disabled by the environment` ) ,
313
+ stderr : `` ,
294
314
exitCode : 1 ,
295
315
} ) ;
296
316
} ) ;
@@ -303,6 +323,7 @@ it(`should support hydrating package managers from cached archives`, async () =>
303
323
await xfs . mktempPromise ( async cwd => {
304
324
await expect ( runCli ( cwd , [ `prepare` , `yarn@2.2.2` , `-o` ] ) ) . resolves . toMatchObject ( {
305
325
exitCode : 0 ,
326
+ stderr : `` ,
306
327
} ) ;
307
328
308
329
// Use a new cache
@@ -314,6 +335,7 @@ it(`should support hydrating package managers from cached archives`, async () =>
314
335
try {
315
336
await expect ( runCli ( cwd , [ `hydrate` , `corepack.tgz` ] ) ) . resolves . toMatchObject ( {
316
337
stdout : `Hydrating yarn@2.2.2...\nAll done!\n` ,
338
+ stderr : `` ,
317
339
exitCode : 0 ,
318
340
} ) ;
319
341
@@ -323,6 +345,7 @@ it(`should support hydrating package managers from cached archives`, async () =>
323
345
324
346
await expect ( runCli ( cwd , [ `yarn` , `--version` ] ) ) . resolves . toMatchObject ( {
325
347
stdout : `2.2.2\n` ,
348
+ stderr : `` ,
326
349
exitCode : 0 ,
327
350
} ) ;
328
351
} finally {
@@ -335,6 +358,7 @@ it(`should support hydrating multiple package managers from cached archives`, as
335
358
await xfs . mktempPromise ( async cwd => {
336
359
await expect ( runCli ( cwd , [ `prepare` , `yarn@2.2.2` , `pnpm@5.8.0` , `-o` ] ) ) . resolves . toMatchObject ( {
337
360
exitCode : 0 ,
361
+ stderr : `` ,
338
362
} ) ;
339
363
340
364
// Use a new cache
@@ -346,6 +370,7 @@ it(`should support hydrating multiple package managers from cached archives`, as
346
370
try {
347
371
await expect ( runCli ( cwd , [ `hydrate` , `corepack.tgz` ] ) ) . resolves . toMatchObject ( {
348
372
stdout : `Hydrating yarn@2.2.2...\nHydrating pnpm@5.8.0...\nAll done!\n` ,
373
+ stderr : `` ,
349
374
exitCode : 0 ,
350
375
} ) ;
351
376
@@ -355,6 +380,7 @@ it(`should support hydrating multiple package managers from cached archives`, as
355
380
356
381
await expect ( runCli ( cwd , [ `yarn` , `--version` ] ) ) . resolves . toMatchObject ( {
357
382
stdout : `2.2.2\n` ,
383
+ stderr : `` ,
358
384
exitCode : 0 ,
359
385
} ) ;
360
386
@@ -364,6 +390,7 @@ it(`should support hydrating multiple package managers from cached archives`, as
364
390
365
391
await expect ( runCli ( cwd , [ `pnpm` , `--version` ] ) ) . resolves . toMatchObject ( {
366
392
stdout : `5.8.0\n` ,
393
+ stderr : `` ,
367
394
exitCode : 0 ,
368
395
} ) ;
369
396
} finally {
@@ -380,11 +407,13 @@ it(`should support running package managers with bin array`, async () => {
380
407
381
408
await expect ( runCli ( cwd , [ `yarnpkg` , `--version` ] ) ) . resolves . toMatchObject ( {
382
409
stdout : `2.2.2\n` ,
410
+ stderr : `` ,
383
411
exitCode : 0 ,
384
412
} ) ;
385
413
386
414
await expect ( runCli ( cwd , [ `yarn` , `--version` ] ) ) . resolves . toMatchObject ( {
387
415
stdout : `2.2.2\n` ,
416
+ stderr : `` ,
388
417
exitCode : 0 ,
389
418
} ) ;
390
419
} ) ;
@@ -403,14 +432,17 @@ it(`should handle parallel installs`, async () => {
403
432
] ) ) . resolves . toMatchObject ( [
404
433
{
405
434
stdout : `2.2.2\n` ,
435
+ stderr : `` ,
406
436
exitCode : 0 ,
407
437
} ,
408
438
{
409
439
stdout : `2.2.2\n` ,
440
+ stderr : `` ,
410
441
exitCode : 0 ,
411
442
} ,
412
443
{
413
444
stdout : `2.2.2\n` ,
445
+ stderr : `` ,
414
446
exitCode : 0 ,
415
447
} ,
416
448
] ) ;
0 commit comments