Compares the preview server with real nginx in tests
The preview server must behave like the real server, or Lighthouse and the browser tests prove the wrong thing. The tests also cover the new URLs in a real browser: one redirect, one title, a clean hydration. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -8,9 +8,10 @@ import { startPreviewServer } from '../../config/previewServer.ts';
|
||||
export const clientDir = resolve('dist/client');
|
||||
|
||||
// Dezelfde server als `pnpm preview`, met de productie-CSP en echte 404's,
|
||||
// op een poort die het systeem kiest zodat tests elkaar niet in de weg zitten
|
||||
export async function startServer() {
|
||||
const server = await startPreviewServer(clientDir, 0);
|
||||
// op een poort die het systeem kiest zodat tests elkaar niet in de weg zitten.
|
||||
// auditRoute zet de opt-in route /__audit/404 aan, zoals Lighthouse hem start.
|
||||
export async function startServer(options: { auditRoute?: boolean } = {}) {
|
||||
const server = await startPreviewServer(clientDir, 0, options);
|
||||
const { port } = server.address() as AddressInfo;
|
||||
return {
|
||||
origin: `http://127.0.0.1:${port}`,
|
||||
|
||||
Reference in New Issue
Block a user