Skip to content

Commit

Permalink
chore: test against latest sharp (vercel#60226)
Browse files Browse the repository at this point in the history
This test was changed in vercel#59074
because the latest sharp stopped working with yarn. However, we can
update these tests to use npm instead and continue testing the latest
sharp.
 
Closes NEXT-1986

Closes vercel#57007
  • Loading branch information
styfle authored and agustints committed Jan 6, 2024
1 parent 2b82162 commit f1af827
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
6 changes: 3 additions & 3 deletions test/integration/image-optimizer/test/old-sharp.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ describe('with outdated sharp', () => {
await fs.writeFile(
join(appDir, 'package.json'),
JSON.stringify({
packageManager: 'yarn@1.22.19',
packageManager: 'npm@10.2.5',
})
)
await execa('yarn', ['add', 'sharp@0.26.3'], {
await execa('npm', ['add', 'sharp@0.26.3'], {
cwd: appDir,
stdio: 'inherit',
})
})
afterAll(async () => {
await fs.remove(join(appDir, 'node_modules'))
await fs.remove(join(appDir, 'yarn.lock'))
await fs.remove(join(appDir, 'package-lock.json'))
await fs.remove(join(appDir, 'package.json'))
})

Expand Down
6 changes: 3 additions & 3 deletions test/integration/image-optimizer/test/sharp.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ describe('with latest sharp', () => {
await fs.writeFile(
join(appDir, 'package.json'),
JSON.stringify({
packageManager: 'yarn@1.22.19',
packageManager: 'npm@10.2.5',
})
)
await execa('yarn', ['add', 'sharp@^0.32.0'], {
await execa('npm', ['add', 'sharp@latest'], {
cwd: appDir,
stdio: 'inherit',
})
})
afterAll(async () => {
await fs.remove(join(appDir, 'node_modules'))
await fs.remove(join(appDir, 'yarn.lock'))
await fs.remove(join(appDir, 'package-lock.json'))
await fs.remove(join(appDir, 'package.json'))
})

Expand Down
4 changes: 1 addition & 3 deletions test/integration/image-optimizer/test/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,7 @@ export function runTests(ctx) {
'custom-sharp.js.nft.json'
)
)
expect(traceFile.files.some((file) => file.includes('sharp/build'))).toBe(
true
)
expect(traceFile.files.some((file) => file.includes('sharp/'))).toBe(true)
})
}

Expand Down

0 comments on commit f1af827

Please sign in to comment.