Skip to content

Commit

Permalink
make sharp tests compatible with corepack
Browse files Browse the repository at this point in the history
  • Loading branch information
ForsakenHarmony committed Aug 4, 2023
1 parent da185d5 commit 3e07449
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
10 changes: 6 additions & 4 deletions test/integration/image-optimizer/test/old-sharp.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
10 changes: 6 additions & 4 deletions test/integration/image-optimizer/test/sharp.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 3e07449

Please sign in to comment.