forked from toeverything/AFFiNE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vitest.config.ts
49 lines (46 loc) · 1.42 KB
/
vitest.config.ts
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 { resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin';
import react from '@vitejs/plugin-react-swc';
import { defineConfig } from 'vitest/config';
const rootDir = fileURLToPath(new URL('.', import.meta.url));
export default defineConfig({
plugins: [react(), vanillaExtractPlugin()],
assetsInclude: ['**/*.md'],
resolve: {
alias: {
// prevent tests using two different sources of yjs
yjs: resolve(rootDir, 'node_modules/yjs'),
'@affine/core': fileURLToPath(
new URL('./packages/frontend/core/src', import.meta.url)
),
},
},
test: {
setupFiles: [
resolve(rootDir, './scripts/setup/lit.ts'),
resolve(rootDir, './scripts/setup/lottie-web.ts'),
resolve(rootDir, './scripts/setup/global.ts'),
],
include: [
resolve(rootDir, 'packages/common/**/*.spec.ts'),
resolve(rootDir, 'packages/common/**/*.spec.tsx'),
resolve(rootDir, 'packages/frontend/**/*.spec.ts'),
resolve(rootDir, 'packages/frontend/**/*.spec.tsx'),
],
exclude: [
'**/node_modules',
'**/dist',
'**/build',
'**/out,',
'**/packages/frontend/electron',
],
testTimeout: 5000,
coverage: {
all: false,
provider: 'istanbul', // or 'c8'
reporter: ['lcov'],
reportsDirectory: resolve(rootDir, '.coverage/store'),
},
},
});