-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathvitest.config.js
51 lines (50 loc) · 1.33 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
40
41
42
43
44
45
46
47
48
49
50
51
// vitest.config.ts
import replace from '@rollup/plugin-replace';
import react from '@vitejs/plugin-react';
import path from 'path';
import { defineConfig } from 'vitest/config';
export default defineConfig({
plugins: [
react(),
replace({
preventAssignment: true,
'process.browser': true,
}),
],
resolve: {
alias: {
// eslint-disable-next-line no-undef
app: path.resolve(__dirname, './src/app'),
crypto: 'crypto-browserify', // Resolve `crypto` to `crypto-browserify`
stream: 'stream-browserify',
},
},
test: {
environment: 'jsdom',
globals: true,
setupFiles: './src/setupTests.ts',
exclude: ['node_modules', 'dist'],
include: ['src/**/*.test.{ts,tsx,js,jsx}', 'test/unit/**/*.test.{ts,tsx,js,jsx}'],
browser: {
provider: 'playwright',
enabled: true,
name: 'chromium',
headless: true,
},
coverage: {
provider: 'istanbul',
reporter: ['text', 'lcov'],
reportsDirectory: './coverage',
include: ['src/**/*.{js,ts,jsx,tsx}', 'test/unit/**/*.{js,ts,jsx,tsx}'],
exclude: ['src/app/drive/components/FileViewer/viewers/FileDocumentViewer/**'],
},
},
optimizeDeps: {
esbuildOptions: {
// Node.js global to browser globalThis
define: {
global: 'globalThis',
},
},
},
});