Skip to content

Commit

Permalink
Turbopack build: Fix next-image invalid import test
Browse files Browse the repository at this point in the history
  • Loading branch information
timneutkens committed Sep 10, 2024
1 parent ca90723 commit 35c5970
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.'
)
}
}
})
}
Expand Down
4 changes: 2 additions & 2 deletions test/turbopack-build-tests-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
],
Expand Down

0 comments on commit 35c5970

Please sign in to comment.