- Add vitest ^4.0.8, jsdom, @vitest/coverage-v8 to devDependencies - Configure vitest.config.ts for jsdom environment with src/**/*.spec.ts pattern - Simplify test-setup.ts (no TestBed needed for standalone unit tests) - Add example spec file src/app/app.spec.ts (5 tests) covering App component logic - Add npm scripts: test:unit, test:unit:watch, test:unit:coverage - Verified: 5/5 frontend tests pass, 86/86 backend pytest tests still pass
22 lines
480 B
TypeScript
22 lines
480 B
TypeScript
/** @type {import('vitest/config').ViteUserConfig} */
|
|
export default {
|
|
test: {
|
|
globals: true,
|
|
environment: 'jsdom',
|
|
include: ['src/**/*.spec.ts'],
|
|
setupFiles: ['src/test-setup.ts'],
|
|
reporters: ['default'],
|
|
coverage: {
|
|
enabled: true,
|
|
reportsDirectory: 'coverage/frontend',
|
|
reporter: ['text', 'html', 'lcov'],
|
|
thresholds: {
|
|
lines: 0,
|
|
branches: 0,
|
|
functions: 0,
|
|
statements: 0,
|
|
},
|
|
},
|
|
},
|
|
};
|