Adds browser tests and fixes hydration of the 404 page
The prerendered 404 page is served for other URLs, so its dehydrated match id differs and the router renders the catch-all's pending component first. Without one that render was empty, which gave React error 418 and duplicate head tags. The tests run the built output in a real browser under the production CSP. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import { existsSync } from 'node:fs';
|
||||
import { join } from 'node:path';
|
||||
import { clientDir } from './server.ts';
|
||||
|
||||
// De browsertests bouwen niets: zonder build testen ze een oude of lege map
|
||||
export default function setup() {
|
||||
if (!existsSync(join(clientDir, 'index.html'))) {
|
||||
throw new Error(
|
||||
`dist/client ontbreekt (${clientDir}). Draai eerst: pnpm build`,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user