0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-30 22:03:56 -05:00
astro/packages/integrations/node/test/fixtures/prerender-404-500/src/nondeterminism-404.ts
Arsh 097a8e4e91
Prerendering corner cases (#8070)
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2023-08-17 09:34:31 +01:00

17 lines
445 B
TypeScript

// This module is only used by the prerendered 404.astro.
// It exhibits different behavior if it's called more than once,
// which is detected by a test and interpreted as a failure.
let usedOnce = false
let dynamicMessage = "Page was not prerendered"
export default function () {
if (usedOnce === false) {
usedOnce = true
return "Page does not exist"
}
dynamicMessage += "+"
return dynamicMessage
}