-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
/
Copy pathvitest.config.ts
81 lines (79 loc) · 1.81 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import { defineConfig } from 'vitest/config';
import { resolve } from 'node:path';
import { pathToFileURL } from 'node:url';
const fixturesPath = resolve(__dirname, 'test/fixtures');
let fixturesUrl = pathToFileURL(fixturesPath).href;
if (!fixturesUrl.endsWith('/')) {
fixturesUrl += '/';
}
export default defineConfig({
resolve: {
alias: {
fabric: resolve(__dirname, './fabric.ts'),
},
},
test: {
pool: 'vmThreads',
clearMocks: true,
mockReset: true,
snapshotSerializers: [
'test/snapshot-serializers/canvas-rendering-context.ts',
],
setupFiles: ['./vitest.setup.ts'],
workspace: [
{
extends: true,
test: {
environment: 'jsdom',
environmentOptions: {
jsdom: {
resources: 'usable',
url: fixturesUrl,
},
},
name: 'unit-node',
},
},
{
extends: true,
test: {
browser: {
provider: 'playwright',
enabled: true,
headless: true,
instances: [{ browser: 'chromium' }],
},
name: 'unit-chromium',
},
},
],
include: [
'src/**/*.test.{ts,tsx}',
'src/**/*.spec.{ts,tsx}',
'extensions/**/*.spec.{ts,tsx}',
'extensions/**/*.test.{ts,tsx}',
],
coverage: {
reportsDirectory: '.nyc_output',
reporter: ['json'],
exclude: [
'test/**',
'dist/**',
'dist-extensions/**',
'src/benchmarks/**',
'vitest*',
'rollup*',
'eslint*',
'playwright*',
'**/node_modules/**',
'.codesandbox/**',
'lib/**',
'e2e/**',
'scripts/**',
'publish-next.js',
'publish.js',
],
provider: 'v8',
},
},
});