Unverified Commit 370b0971 authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

Turbopack Build: Fix metadata-edge test (#80842)

This test is checking if `@vercel/og` gets shared between two routes, it
assumed that `next/og` itself (the wrapper code) would also be chunked,
but the size limit for Turbopack is slightly larger so it doesn't end up
bundling it into a separate chunk. Changed the test to check that
`@vercel/og` is correctly chunked.
parent ad27ddab
...@@ -22,21 +22,26 @@ describe('app dir - Metadata API on the Edge runtime', () => { ...@@ -22,21 +22,26 @@ describe('app dir - Metadata API on the Edge runtime', () => {
(file) => { (file) => {
return next return next
.readFileSync(path.join('.next', file)) .readFileSync(path.join('.next', file))
.includes('ImageResponse') .includes('experimental_FigmaImageResponse')
} }
) )
expect(pageFilesThatHaveImageResponse).not.toBeEmpty()
const uniqueAnotherFiles = [ const uniqueAnotherFiles = [
...new Set<string>( ...new Set<string>(
middlewareManifest.functions['/another/page'].files middlewareManifest.functions['/another/page'].files
), ),
] ]
expect(uniqueAnotherFiles).not.toBeEmpty()
const anotherFilesThatHaveImageResponse = uniqueAnotherFiles.filter( const anotherFilesThatHaveImageResponse = uniqueAnotherFiles.filter(
(file) => { (file) => {
return next return (
.readFileSync(path.join('.next', file)) next
.includes('ImageResponse') .readFileSync(path.join('.next', file))
// This export is not used but it checks if the `@vercel/og` package is shared between the two routes.
.includes('experimental_FigmaImageResponse')
)
} }
) )
......
...@@ -3045,11 +3045,10 @@ ...@@ -3045,11 +3045,10 @@
}, },
"test/e2e/app-dir/metadata-edge/index.test.ts": { "test/e2e/app-dir/metadata-edge/index.test.ts": {
"passed": [ "passed": [
"app dir - Metadata API on the Edge runtime should render OpenGraph image meta tag correctly" "app dir - Metadata API on the Edge runtime should render OpenGraph image meta tag correctly",
],
"failed": [
"app dir - Metadata API on the Edge runtime OG image route should not bundle `ImageResponse` into the page worker" "app dir - Metadata API on the Edge runtime OG image route should not bundle `ImageResponse` into the page worker"
], ],
"failed": [],
"pending": [], "pending": [],
"flakey": [], "flakey": [],
"runtimeError": false "runtimeError": false
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment