-
Notifications
You must be signed in to change notification settings - Fork 48
Expand file tree
/
Copy pathvitest.config.ts
More file actions
34 lines (31 loc) · 1.04 KB
/
vitest.config.ts
File metadata and controls
34 lines (31 loc) · 1.04 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
import * as path from 'node:path';
import * as url from 'node:url';
import { defineConfig } from 'vitest/config';
import GithubActionsReporter from 'vitest-github-actions-reporter';
const dirname = url.fileURLToPath(new URL('.', import.meta.url));
export default defineConfig({
resolve: {
alias: [
// mock *.svg and *.svg?react file
{ find: /.*\.svg(\?react)?$/, replacement: path.resolve(dirname, 'tests/__mocks__/svg.js') },
{ find: '@bangumi/website', replacement: path.resolve(dirname, './packages/website/src') },
],
},
test: {
exclude: ['**/node_modules', '**/dist', '**/e2e', '.git', '.cache', '.idea'],
globals: true,
reporters: process.env.GITHUB_ACTIONS ? ['default', new GithubActionsReporter()] : 'default',
environment: 'jsdom',
sequence: {
setupFiles: 'list',
},
setupFiles: ['./tests/setup.ts', './tests/website.ts'],
snapshotFormat: {
printBasicPrototype: true,
},
coverage: {
provider: 'v8',
reporter: ['lcov', 'text-summary'],
},
},
});