forked from benweet/stackedit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.mjs
More file actions
49 lines (47 loc) · 1.5 KB
/
Copy pathvitest.config.mjs
File metadata and controls
49 lines (47 loc) · 1.5 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 vue from '@vitejs/plugin-vue';
import path from 'path';
import { fileURLToPath } from 'node:url';
const here = path.dirname(fileURLToPath(import.meta.url));
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
'@': path.resolve(here, 'src'),
},
// Match the production extensions list so `.vue` imports without
// explicit extension resolve in tests too (e.g. src/icons/index.js
// does `import Provider from './Provider';`).
extensions: ['.mjs', '.js', '.ts', '.vue', '.json'],
},
define: {
VERSION: JSON.stringify('0.0.0-test'),
NODE_ENV: JSON.stringify('test'),
GOOGLE_CLIENT_ID: JSON.stringify(''),
GITHUB_CLIENT_ID: JSON.stringify(''),
},
test: {
environment: 'happy-dom',
environmentOptions: {
happyDOM: {
settings: {
disableCSSFileLoading: true,
disableComputedStyleRendering: true,
disableErrorCapturing: true,
},
},
},
dangerouslyIgnoreUnhandledErrors: true,
globals: true,
include: ['test/unit/**/*.spec.js'],
setupFiles: ['test/unit/setup.js'],
// templateWorker.spec.js spawns a node:worker_threads worker. Vitest's
// default pool ('forks' in v4) handles this fine; 'vmThreads' would not.
pool: 'forks',
coverage: {
provider: 'v8',
include: ['src/libs/**/*.js', 'api/**/*.js', 'dev-server/**/*.js', 'src/services/networkSvc.js'],
reporter: ['text', 'html'],
},
},
});