forked from antfu/shikiji
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvitest.config.ts
67 lines (64 loc) · 2.54 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
import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitest/config'
import { wasmPlugin } from './packages/shikiji-core/rollup.config.mjs'
export default defineConfig({
plugins: [
wasmPlugin(),
],
resolve: {
alias: {
'shikiji-core/wasm-inlined': fileURLToPath(new URL('./packages/shikiji-core/src/wasm-inlined.ts', import.meta.url)),
'shikiji-core/types': fileURLToPath(new URL('./packages/shikiji-core/src/types.ts', import.meta.url)),
'shikiji-core': fileURLToPath(new URL('./packages/shikiji-core/src/index.ts', import.meta.url)),
'shikiji-transformers': fileURLToPath(new URL('./packages/shikiji-transformers/src/index.ts', import.meta.url)),
'shikiji-compat': fileURLToPath(new URL('./packages/shikiji-compat/src/index.ts', import.meta.url)),
'shikiji-twoslash/core': fileURLToPath(new URL('./packages/shikiji-twoslash/src/core.ts', import.meta.url)),
'shikiji-twoslash': fileURLToPath(new URL('./packages/shikiji-twoslash/src/index.ts', import.meta.url)),
'vitepress-plugin-twoslash': fileURLToPath(new URL('./packages/vitepress-plugin-twoslash/src/index.ts', import.meta.url)),
'markdown-it-shikiji': fileURLToPath(new URL('./packages/markdown-it-shikiji/src/index.ts', import.meta.url)),
'shikiji/wasm': fileURLToPath(new URL('./packages/shikiji/src/wasm.ts', import.meta.url)),
'shikiji/core': fileURLToPath(new URL('./packages/shikiji/src/core.ts', import.meta.url)),
'shikiji/bundle/full': fileURLToPath(new URL('./packages/shikiji/src/bundle-full.ts', import.meta.url)),
'shikiji/bundle/web': fileURLToPath(new URL('./packages/shikiji/src/bundle-web.ts', import.meta.url)),
'shikiji': fileURLToPath(new URL('./packages/shikiji/src/index.ts', import.meta.url)),
},
},
test: {
exclude: [
'**/vendor/**',
'**/node_modules/**',
],
server: {
deps: {
inline: [
/\.wasm/,
],
},
},
coverage: {
provider: 'v8',
include: [
'**/packages/*/src/**/*.ts',
],
exclude: [
'**/node_modules/**',
'**/dist/**',
'**/scripts/**',
// Vendored code
'**/vendor/**',
'**/stack-element-metadata.ts',
'**/src/oniguruma/**',
'**/src/assets/**',
// Integration packages that are hard to cover, or tested elsewhere
'**/shikiji-cli/**',
'**/shikiji-monaco/**',
'**/vitepress-plugin-twoslash/**',
],
},
poolOptions: {
threads: {
singleThread: true,
},
},
},
})