-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathvitest.config.ts
More file actions
49 lines (47 loc) · 1.65 KB
/
Copy pathvitest.config.ts
File metadata and controls
49 lines (47 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
import { defineConfig } from 'vitest/config';
import path from 'path';
import vue from '@vitejs/plugin-vue';
// Duplicate vite type trees (root vs vitest's bundled) cause overload mismatch.
// We intentionally cast the plugin to any to bypass structural mismatch.
// No dependency version changes per instruction.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const vueAny: any = vue;
export default defineConfig({
// Casted plugin to avoid TS 2769 noise only in editor; runtime unaffected.
plugins: [vueAny()],
resolve: {
alias: {
'#imports': path.resolve(__dirname, 'tests/stubs/nuxt-imports.ts'),
'~': path.resolve(__dirname, 'app'),
'~~': path.resolve(__dirname),
'~~/': path.resolve(__dirname) + '/',
'#app': path.resolve(__dirname, 'tests/stubs/nuxt-app.ts'),
},
},
test: {
environment: 'jsdom',
globals: true,
include: [
'app/**/__tests__/**/*.test.ts',
'scripts/__tests__/**/*.test.ts',
'tests/unit/**/*.test.ts',
],
exclude: ['node_modules', 'dist', '.nuxt'],
setupFiles: ['tests/setup.ts'],
testTimeout: 10000,
hookTimeout: 10000,
bail: 1,
coverage: {
provider: 'v8',
reportsDirectory: './coverage',
reporter: ['text', 'html'],
include: ['app/composables/useStreamAccumulator.ts'],
thresholds: {
lines: 90,
statements: 90,
branches: 90,
functions: 75, // helper functions covered adequately
},
},
},
});