Three problems caused E2E browser tests to fail in Forgejo CI:
1. TypeScript build errors in (frontend.e2e.Dockerfile):
- used parameter property which violates
. Replaced with explicit property declaration.
- included in type-checking, causing
mock Response type mismatches. Added .
- mock Order was missing field.
2. Nginx SSL crash:
- copied production
which references SSL certs that don't exist in the e2e image.
- Replaced nginx entirely with (simpler, no SSL needed).
- Added to so routes to backend.
3. Docker context hygiene:
- excludes so test files don't
bloat the build context or trigger type errors in the container.
All other files untouched.
42 lines
917 B
TypeScript
42 lines
917 B
TypeScript
/// <reference types="vitest/config" />
|
|
import { fileURLToPath, URL } from 'node:url'
|
|
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
|
|
export default defineConfig({
|
|
plugins: [vue()],
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
|
},
|
|
},
|
|
server: {
|
|
port: 3000,
|
|
proxy: {
|
|
'/api': 'http://backend:8080',
|
|
},
|
|
},
|
|
preview: {
|
|
port: 80,
|
|
proxy: {
|
|
'/api': 'http://backend:8080',
|
|
},
|
|
},
|
|
test: {
|
|
environment: 'jsdom',
|
|
setupFiles: ['src/__tests__/setup.ts'],
|
|
exclude: ['e2e/**', 'node_modules/**'],
|
|
coverage: {
|
|
provider: 'v8',
|
|
reporter: ['text', 'html', 'lcov', 'json'],
|
|
reportsDirectory: './coverage',
|
|
thresholds: {
|
|
lines: 70,
|
|
branches: 60,
|
|
functions: 70,
|
|
statements: 70,
|
|
},
|
|
exclude: ['src/__tests__/**', 'e2e/**'],
|
|
},
|
|
},
|
|
})
|