-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
51 lines (50 loc) · 1.65 KB
/
vitest.config.ts
File metadata and controls
51 lines (50 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/// <reference types="vitest" />
import { getViteConfig } from 'astro/config';
// Define Vitest specific config directly
// https://docs.astro.build/en/guides/testing/#vitest
export default getViteConfig ({
test: {
environment: 'jsdom', // Use jsdom for DOM simulation
globals: true, // Make Vitest APIs global (describe, it, expect)
setupFiles: ['./src/vitest.setup.ts'], // Run setup file before tests
exclude: [
'**/node_modules/**',
'**/dist/**',
'**/tests/**', // Exclude playwright tests folder
'**/test-results/**',
'playwright.config.ts',
'astro.config.mjs',
'tailwind.config.ts',
'biome.json',
'scripts/**',
'vitest.config.ts', // Exclude self
],
// Include source files for coverage, adjust pattern as needed
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html', 'lcov'],
include: ['src/components/FormattedDate.astro'], // Focus coverage on the target component
exclude: [
'src/env.d.ts',
'src/pages/**',
'src/layouts/**',
'src/content/**',
'src/lib/**', // Exclude lib unless testing utils specifically
'src/styles/**',
'src/consts.ts',
'src/vitest.setup.ts',
'**/node_modules/**',
'**/dist/**',
'**/tests/**', // Exclude playwright tests folder
'**/test-results/**',
'playwright.config.ts',
'astro.config.mjs',
'tailwind.config.ts',
'biome.json',
'scripts/**',
'vitest.config.ts', // Exclude self
],
},
},
},
);