From 3e074491c3a2ff8836ca792f555455f2dea0b66e Mon Sep 17 00:00:00 2001 From: hrmny Date: Fri, 4 Aug 2023 20:50:36 +0200 Subject: [PATCH] make sharp tests compatible with corepack --- .../integration/image-optimizer/test/old-sharp.test.ts | 10 ++++++---- test/integration/image-optimizer/test/sharp.test.ts | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/test/integration/image-optimizer/test/old-sharp.test.ts b/test/integration/image-optimizer/test/old-sharp.test.ts index c7058b89ff1f7f..0f16eba78a17a2 100644 --- a/test/integration/image-optimizer/test/old-sharp.test.ts +++ b/test/integration/image-optimizer/test/old-sharp.test.ts @@ -8,10 +8,12 @@ const imagesDir = join(appDir, '.next', 'cache', 'images') describe('with outdated sharp', () => { beforeAll(async () => { - await execa('yarn', ['init', '-y'], { - cwd: appDir, - stdio: 'inherit', - }) + await fs.writeFile( + join(appDir, 'package.json'), + JSON.stringify({ + packageManager: 'yarn@1.22.19', + }) + ) await execa('yarn', ['add', 'sharp@0.26.3'], { cwd: appDir, stdio: 'inherit', diff --git a/test/integration/image-optimizer/test/sharp.test.ts b/test/integration/image-optimizer/test/sharp.test.ts index 27105a870edd80..6adb74221122ad 100644 --- a/test/integration/image-optimizer/test/sharp.test.ts +++ b/test/integration/image-optimizer/test/sharp.test.ts @@ -8,10 +8,12 @@ const imagesDir = join(appDir, '.next', 'cache', 'images') describe('with latest sharp', () => { beforeAll(async () => { - await execa('yarn', ['init', '-y'], { - cwd: appDir, - stdio: 'inherit', - }) + await fs.writeFile( + join(appDir, 'package.json'), + JSON.stringify({ + packageManager: 'yarn@1.22.19', + }) + ) await execa('yarn', ['add', 'sharp'], { cwd: appDir, stdio: 'inherit',