-
Notifications
You must be signed in to change notification settings - Fork 43
/
vitest.config.ts
33 lines (30 loc) · 1.02 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
import * as path from 'node:path';
import * as url from 'node:url';
import react from '@vitejs/plugin-react';
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 file
{ find: /.*\.svg$/, replacement: path.resolve(dirname, 'tests/__mocks__/svg.js') },
{ find: '@bangumi/website', replacement: path.resolve(dirname, './packages/website/src') },
],
},
plugins: [react()],
test: {
exclude: ['**/node_modules', '**/dist', '**/e2e', '.git', '.cache', '.idea'],
globals: true,
reporters: process.env.GITHUB_ACTIONS ? ['default', new GithubActionsReporter()] : 'default',
environment: 'jsdom',
setupFiles: ['./tests/setup.ts', './tests/website.ts'],
snapshotFormat: {
printBasicPrototype: true,
},
coverage: {
provider: 'v8',
reporter: ['lcov', 'text-summary'],
},
},
});