-
Notifications
You must be signed in to change notification settings - Fork 0
/
vitest.config.js
39 lines (36 loc) · 1.07 KB
/
vitest.config.js
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
import typescript from '@rollup/plugin-typescript';
import { createRequire } from 'node:module';
import path from 'node:path';
import { configDefaults, defineConfig } from 'vitest/config';
import { useRootDirname } from './scripts/utils.js';
const require = createRequire(import.meta.url);
const packages = require('./scripts/entries.cjs')();
const rootDirname = useRootDirname();
export default defineConfig({
resolve: {
alias: packages.reduce((aliases, pkg) => ({
...aliases, [pkg.path]: path.resolve(rootDirname, 'packages', pkg.name, 'src'),
}), {}),
},
test: {
globals: true,
environment: 'jsdom',
coverage: {
provider: 'istanbul',
all: true,
include: ['packages/*/src/**'],
exclude: [...configDefaults.coverage.exclude, 'packages/cli/src/**'],
},
typecheck: {
tsconfig: path.resolve(rootDirname, 'tsconfig.json'),
},
},
plugins: [
typescript({
tsconfig: path.resolve(rootDirname, 'tsconfig.json'),
sourceMap: true,
sourceRoot: rootDirname,
inlineSources: true,
}),
],
});