- Created package.json with Vitest and Playwright dependencies - Configured vitest.config.js with happy-dom environment - Configured playwright.config.js with Chromium browser - Created test directory structure (tests/frontend/unit and e2e) - Added setup.test.js with 10 Vitest validation tests - Added setup.spec.js with 6 Playwright E2E validation tests - Created FRONTEND_SETUP.md with Node.js installation guide - Updated instructions.md marking task complete Note: Requires Node.js installation before running tests
47 lines
1007 B
JavaScript
47 lines
1007 B
JavaScript
import path from 'path';
|
|
import { defineConfig } from 'vitest/config';
|
|
|
|
export default defineConfig({
|
|
test: {
|
|
// Use happy-dom for faster DOM testing
|
|
environment: 'happy-dom',
|
|
|
|
// Include test files
|
|
include: ['tests/frontend/unit/**/*.{test,spec}.{js,mjs,cjs}'],
|
|
|
|
// Global test utilities
|
|
globals: true,
|
|
|
|
// Coverage configuration
|
|
coverage: {
|
|
provider: 'v8',
|
|
reporter: ['text', 'html', 'json'],
|
|
reportsDirectory: './htmlcov_frontend',
|
|
include: ['src/server/web/static/js/**/*.js'],
|
|
exclude: [
|
|
'node_modules/',
|
|
'tests/',
|
|
'**/*.test.js',
|
|
'**/*.spec.js'
|
|
],
|
|
all: true,
|
|
lines: 80,
|
|
functions: 80,
|
|
branches: 80,
|
|
statements: 80
|
|
},
|
|
|
|
// Test timeout (30 seconds)
|
|
testTimeout: 30000,
|
|
|
|
// Hook timeout (10 seconds)
|
|
hookTimeout: 10000
|
|
},
|
|
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, './src/server/web/static/js')
|
|
}
|
|
}
|
|
});
|