Files
Sluijsens 22bc5c5cde
Continuous Integration / config (pull_request) Successful in 10s
Continuous Integration / backend-build (pull_request) Successful in 4m48s
Continuous Integration / vulnerability-scan (pull_request) Successful in 4m33s
Continuous Integration / frontend-prepare (pull_request) Successful in 1m47s
Continuous Integration / backend-test (pull_request) Successful in 5m17s
Continuous Integration / frontend-build (pull_request) Successful in 2m13s
Continuous Integration / frontend-test (pull_request) Successful in 4m22s
Continuous Integration / frontend-lint (pull_request) Successful in 2m0s
Continuous Integration / publish-production (pull_request) Skipped
Continuous Integration / deploy-production (pull_request) Skipped
Continuous Integration / publish-test (pull_request) Successful in 6m18s
Deploy (SCP) / deploy (pull_request) Successful in 1m28s
Continuous Integration / deploy-test (pull_request) Successful in 1m29s
Doubles frontend test findBy* timeouts to reduce CI flakiness
5000ms was occasionally too tight on the self-hosted Actions runner for
lazy-loaded routes gated behind an async setup-status check (observed on
SettingsPage.test.tsx, passed reliably locally). Bumps to 10000ms across all
nine test files using that pattern, and raises vite.config.ts's global
testTimeout from 15000 to 20000 to keep headroom above it.
2026-07-30 12:32:58 +02:00

64 lines
2.4 KiB
TypeScript

/// <reference types="vitest/config" />
import path from 'node:path';
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import tailwindcss from '@tailwindcss/vite';
import { version } from './package.json';
// https://vite.dev/config/
export default defineConfig(({ command }) => ({
// Production builds are deployed under /admin (see Program.cs); the dev server keeps serving from '/'.
base: command === 'build' ? '/admin/' : '/',
plugins: [react(), tailwindcss()],
define: {
// Injected at build time, used as the Sentry `release` tag (see src/lib/sentry.ts).
__APP_VERSION__: JSON.stringify(version),
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
server: {
port: 5173,
proxy: {
// Mirrors the tunnel path the API serves in test and production, so the same
// Sentry `tunnel` option also works during `pnpm dev` — where this SPA runs on
// 5173 and the API on 7221.
//
// Note this targets our own API rather than Sentry's ingest host directly. The
// reference project proxies straight to Sentry, which forces the DSN's project id
// into this file and requires keeping it in sync by hand. The API derives the
// destination from its own DSN, so there is nothing to synchronise and no project
// id in a committed file.
'/sentry-tunnel': {
target: 'https://localhost:7221',
changeOrigin: true,
secure: false,
},
},
},
test: {
globals: true,
environment: 'jsdom',
setupFiles: ['./src/test/setup.ts'],
testTimeout: 20000,
css: true,
coverage: {
provider: 'v8',
reporter: ['text', 'html'],
include: ['src/**/*.{ts,tsx}'],
exclude: [
'src/**/*.test.{ts,tsx}',
'src/test/**',
'src/mocks/**',
'src/main.tsx',
'src/vite-env.d.ts',
// Calls Sentry.init, which cannot run meaningfully under jsdom; its skip-without-
// a-DSN behaviour is covered by a test that asserts init was not called.
'src/lib/sentry.ts',
],
},
},
}));