Files
Charon/frontend/vitest.config.ts
GitHub Actions 2b2d907b0c fix: enhance notifications and validation features
- Added URL validation for notification providers to ensure only valid http/https URLs are accepted.
- Implemented tests for URL validation scenarios in the Notifications component.
- Updated translations for error messages related to invalid URLs in multiple languages.
- Introduced new hooks for managing security headers and access lists in tests.
- Enhanced the ProviderForm component to reset state correctly when switching between add and edit modes.
- Improved user feedback with update indicators after saving changes to notification providers.
- Added mock implementations for new hooks in various test files to ensure consistent testing behavior.
2026-02-10 22:01:45 +00:00

56 lines
1.4 KiB
TypeScript

import { defineConfig } from 'vitest/config'
import react from '@vitejs/plugin-react'
// Dynamic coverage threshold (align local and CI)
const coverageThresholdValue =
process.env.CHARON_MIN_COVERAGE ?? process.env.CPM_MIN_COVERAGE ?? '85.0'
const coverageThreshold = Number.parseFloat(coverageThresholdValue)
const resolvedCoverageThreshold = Number.isNaN(coverageThreshold) ? 85.0 : coverageThreshold
export default defineConfig({
plugins: [react()],
test: {
pool: 'forks',
poolOptions: {
forks: {
memoryLimit: '512MB',
},
},
globals: true,
environment: 'jsdom',
environmentOptions: {
jsdom: {
url: 'http://localhost',
},
},
setupFiles: './src/test/setup.ts',
// TypeScript types for test globals - these are automatically available in test files
typecheck: {
tsconfig: './tsconfig.json',
},
exclude: [
'node_modules/**',
'dist/**',
'e2e/**', // Playwright E2E tests - run separately
'tests/**', // Playwright smoke tests - run separately
],
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html', 'lcov', 'json-summary'],
exclude: [
'node_modules/',
'src/locales/**',
'src/test/',
'**/*.d.ts',
'**/*.config.*',
'**/mockData.ts',
'dist/',
'e2e/',
],
thresholds: {
lines: resolvedCoverageThreshold,
},
},
},
})