Skip to content

Commit

Permalink
test: intentionally break deps installation / fixture build to test p…
Browse files Browse the repository at this point in the history
…repare script changes
  • Loading branch information
pieh committed Jan 27, 2025
1 parent fe86e9f commit 9e2e4e8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion tests/fixtures/wasm-src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"@vercel/og": "latest",
"next": "latest",
"react": "18.2.0",
"react-dom": "18.2.0"
"react-dom": "18.2.0",
"package-that-does-not-exist": "^1.0.0"
}
}
2 changes: 1 addition & 1 deletion tests/fixtures/wasm/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default async function middleware(request) {
const value = await increment(input)
return new Response(null, { headers: { data: JSON.stringify({ input, value }) } })
}

blah blah - this should not build
export const config = {
matcher: '/wasm',
}
8 changes: 4 additions & 4 deletions tests/prepare.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ const promises = fixtures.map((fixture) =>
})
}
if (output.exitCode !== 0) {
const errorMessage = `[${fixture}] Failed to install dependencies or build a fixture`
console.error(errorMessage)
const errorMessage = `[${fixture}] 🚨 Failed to install dependencies or build a fixture`
console.error(`\n${errorMessage}`)
throw new Error(errorMessage)
}
fixtureList.delete(fixture)
Expand All @@ -107,9 +107,9 @@ const failedFixturesErrors = prepareFixturesResults
.filter(Boolean)

if (failedFixturesErrors.length > 0) {
console.error('🚨 Some fixtures failed to prepare:')
console.error('Some fixtures failed to prepare:')
for (const error of failedFixturesErrors) {
console.error(error)
console.error(error.message)
}
process.exit(1)
}
Expand Down

0 comments on commit 9e2e4e8

Please sign in to comment.