Files
readest/apps/readest-app/vitest.config.mts
T
Huang Xin 0e516f6e56 chore(test): add unit tests and enforce dash-case naming for test files (#3715)
Add ~290 new unit tests covering utils (lru, diff, css, a11y, walk,
usage, txt-worker), services (EdgeTTSClient, transformers), and
suppress noisy console output across all test files. Rename 27
camelCase test files to dash-case for consistency.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 09:14:00 +02:00

38 lines
1020 B
TypeScript

import path from 'path';
import { defineConfig } from 'vitest/config';
import react from '@vitejs/plugin-react';
import tsconfigPaths from 'vite-tsconfig-paths';
export default defineConfig({
plugins: [tsconfigPaths(), react()],
resolve: {
alias: {
// The @pdfjs alias from tsconfig only resolves within the app's own
// source files. foliate-js/pdf.js lives outside that scope, so Vite
// needs an explicit alias to find the vendored pdfjs build.
'@pdfjs': path.resolve(__dirname, 'public/vendor/pdfjs'),
},
},
test: {
environment: 'jsdom',
setupFiles: ['./vitest.setup.ts'],
exclude: [
'**/node_modules/**',
'**/dist/**',
'**/.claude/**',
'**/*.browser.test.ts',
'**/*.tauri.test.ts',
],
coverage: {
provider: 'v8',
reporter: ['text', 'text-summary'],
include: ['src/**/*.{ts,tsx}'],
exclude: [
'src/**/*.d.ts',
'src/**/__tests__/**',
'src/**/test/**',
],
},
},
});