Fixes CI test timeouts on the arm64 runner
The first render with axe takes up to 7 s on the Raspberry Pi runner, above Vitest's 5 s default; the suite now allows 20 s per test. Also silences the router warning in the test that crashes a page on purpose, and makes the nginx test config return 404 instead of a redirect loop (500) while the test folder is still empty. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -39,7 +39,7 @@ describe('serverconfiguratie', () => {
|
||||
const nginx = nginxTestConf();
|
||||
expect(nginx).toContain('X-Robots-Tag "noindex, nofollow"');
|
||||
expect(nginx).toContain('Disallow: /');
|
||||
expect(nginx).toContain('try_files $uri $uri/ /index.html;');
|
||||
expect(nginx).toContain('try_files $uri $uri/ /index.html =404;');
|
||||
});
|
||||
|
||||
it('het testblok claimt nooit de standaardserver (WordPress op dezelfde Pi)', () => {
|
||||
|
||||
@@ -117,10 +117,12 @@ ${block(' ', ['add_header Cache-Control "public, max-age=31536000, immuta
|
||||
try_files $uri =404;
|
||||
}
|
||||
|
||||
# SPA-fallback: onbekende paden krijgen index.html (de router toont de 404)
|
||||
# SPA-fallback: onbekende paden krijgen index.html (de router toont de 404).
|
||||
# =404 aan het eind: zonder index.html (lege map) een 404 in plaats van een
|
||||
# doorverwijzingslus die nginx als 500 afbreekt
|
||||
location / {
|
||||
${block(' ', ['add_header Cache-Control "no-cache" always;'])}
|
||||
try_files $uri $uri/ /index.html;
|
||||
try_files $uri $uri/ /index.html =404;
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -47,7 +47,9 @@ server {
|
||||
try_files $uri =404;
|
||||
}
|
||||
|
||||
# SPA-fallback: onbekende paden krijgen index.html (de router toont de 404)
|
||||
# SPA-fallback: onbekende paden krijgen index.html (de router toont de 404).
|
||||
# =404 aan het eind: zonder index.html (lege map) een 404 in plaats van een
|
||||
# doorverwijzingslus die nginx als 500 afbreekt
|
||||
location / {
|
||||
add_header Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self'; connect-src 'self'; object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'" always;
|
||||
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
|
||||
@@ -56,6 +58,6 @@ server {
|
||||
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
||||
add_header X-Robots-Tag "noindex, nofollow" always;
|
||||
add_header Cache-Control "no-cache" always;
|
||||
try_files $uri $uri/ /index.html;
|
||||
try_files $uri $uri/ /index.html =404;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,6 +107,8 @@ describe('app', () => {
|
||||
it('toont een fout in een pagina als foutpagina binnen de shell', async () => {
|
||||
crash.enabled = true;
|
||||
vi.spyOn(console, 'error').mockImplementation(() => {});
|
||||
// De router meldt de bewust gegooide fout ook als waarschuwing
|
||||
vi.spyOn(console, 'warn').mockImplementation(() => {});
|
||||
await renderApp('/portfolio');
|
||||
expect(
|
||||
await screen.findByRole('heading', {
|
||||
|
||||
@@ -33,6 +33,9 @@ export default defineConfig({
|
||||
preview: { headers: securityHeaders('production') },
|
||||
test: {
|
||||
environment: 'jsdom',
|
||||
// De CI-runner (Raspberry Pi, arm64) is ±5-8x trager dan een pc; de
|
||||
// eerste render met axe duurt daar tot 7 s. 5 s (standaard) is te krap.
|
||||
testTimeout: 20_000,
|
||||
globalSetup: ['./config/testSeed.ts'],
|
||||
setupFiles: ['./src/test/setup.ts'],
|
||||
css: false,
|
||||
|
||||
Reference in New Issue
Block a user