From adb60631ece3b88c9f970e718656793f8b1301f4 Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Tue, 10 Sep 2024 16:22:08 +0200 Subject: [PATCH] Turbopack build: Fix next-image invalid import test (#69921) Fixes the test, matched development. --- .../invalid-image-import/test/index.test.ts | 15 ++++++++++++--- test/turbopack-build-tests-manifest.json | 4 ++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/test/integration/next-image-new/invalid-image-import/test/index.test.ts b/test/integration/next-image-new/invalid-image-import/test/index.test.ts index d6b7dfd7a696e..17c0dde443917 100644 --- a/test/integration/next-image-new/invalid-image-import/test/index.test.ts +++ b/test/integration/next-image-new/invalid-image-import/test/index.test.ts @@ -41,9 +41,18 @@ function runTests({ isDev }) { `) } } else { - expect(stripAnsi(stderr)).toContain( - 'Error: Image import "../public/invalid.svg" is not a valid image file. The image may be corrupted or an unsupported format.' - ) + const output = stripAnsi(stderr) + if (process.env.TURBOPACK) { + expect(output).toContain( + `./test/integration/next-image-new/invalid-image-import/public/invalid.svg +Processing image failed +Failed to parse svg source code for image dimensions` + ) + } else { + expect(output).toContain( + 'Error: Image import "../public/invalid.svg" is not a valid image file. The image may be corrupted or an unsupported format.' + ) + } } }) } diff --git a/test/turbopack-build-tests-manifest.json b/test/turbopack-build-tests-manifest.json index 1b944ecd3f928..a5263d1653df7 100644 --- a/test/turbopack-build-tests-manifest.json +++ b/test/turbopack-build-tests-manifest.json @@ -13675,10 +13675,10 @@ "runtimeError": false }, "test/integration/next-image-new/invalid-image-import/test/index.test.ts": { - "passed": [], - "failed": [ + "passed": [ "Missing Import Image Tests production mode should show error" ], + "failed": [], "pending": [ "Missing Import Image Tests development mode should show error" ],