-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvitest.config.ts
More file actions
59 lines (58 loc) · 1.64 KB
/
vitest.config.ts
File metadata and controls
59 lines (58 loc) · 1.64 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
52
53
54
55
56
57
58
59
import { defineConfig } from 'vitest/config';
import angular from '@analogjs/vite-plugin-angular';
import { resolve } from 'path';
export default defineConfig({
resolve: {
alias: {
'@app': resolve(__dirname, './src/app'),
'@assets': resolve(__dirname, './src/assets'),
'@environments': resolve(__dirname, './src/environments'),
'@testing': resolve(__dirname, './src/testing'),
},
},
optimizeDeps: {
// Don't pre-bundle these to ensure JIT compiler is available
exclude: ['@angular/compiler'],
include: ['@angular/common', '@angular/core', '@angular/platform-browser-dynamic'],
},
plugins: [
angular({
tsconfig: './tsconfig.spec.json',
jit: true, // Enable JIT compilation mode
}),
],
test: {
globals: true,
environment: 'jsdom',
include: ['src/**/*.spec.ts'],
exclude: [
// Integration tests have transitive Angular Material dependencies that
// can't compile in vitest/JSDOM. Keep excluded until migrated to Playwright.
'src/app/pages/dfd/integration/**',
'src/app/pages/dfd/infrastructure/adapters/x6-graph.adapter.spec.ts',
],
setupFiles: ['src/test-setup.ts'],
server: {
deps: {
inline: [/^@angular/, /^@jsverse/],
},
},
coverage: {
provider: 'v8',
reporter: ['text', 'html'],
exclude: [
'node_modules/',
'src/test-setup.ts',
'**/*.d.ts',
'**/*.spec.ts',
'**/environments/**',
'unused/**',
],
},
// Use 'forks' pool for Zone.js compatibility
isolate: true,
pool: 'forks',
restoreMocks: true,
clearMocks: true,
},
});