From 51990f92dd5bbed4c25a0e03a702f303bd47bbed Mon Sep 17 00:00:00 2001 From: Steven Date: Thu, 4 Jan 2024 12:25:25 -0500 Subject: [PATCH 1/2] chore: test against latest sharp --- test/integration/image-optimizer/test/old-sharp.test.ts | 6 +++--- test/integration/image-optimizer/test/sharp.test.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/integration/image-optimizer/test/old-sharp.test.ts b/test/integration/image-optimizer/test/old-sharp.test.ts index 0f16eba78a17a..3e3a970c74abf 100644 --- a/test/integration/image-optimizer/test/old-sharp.test.ts +++ b/test/integration/image-optimizer/test/old-sharp.test.ts @@ -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')) }) diff --git a/test/integration/image-optimizer/test/sharp.test.ts b/test/integration/image-optimizer/test/sharp.test.ts index e2b5b209d88d2..fefbeeaec02d4 100644 --- a/test/integration/image-optimizer/test/sharp.test.ts +++ b/test/integration/image-optimizer/test/sharp.test.ts @@ -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')) }) From 5683fb62b7c4e13a470d0600ffc736defdc0ccb2 Mon Sep 17 00:00:00 2001 From: Steven Date: Thu, 4 Jan 2024 12:33:35 -0500 Subject: [PATCH 2/2] fix test --- test/integration/image-optimizer/test/util.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/integration/image-optimizer/test/util.ts b/test/integration/image-optimizer/test/util.ts index 3eb9acf795d11..f3442cde830ab 100644 --- a/test/integration/image-optimizer/test/util.ts +++ b/test/integration/image-optimizer/test/util.ts @@ -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) }) }