-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathvitest.config.ts
More file actions
35 lines (34 loc) · 750 Bytes
/
vitest.config.ts
File metadata and controls
35 lines (34 loc) · 750 Bytes
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
import { defineConfig } from 'vitest/config';
import react from '@vitejs/plugin-react';
export default defineConfig({
plugins: [
react(),
{
name: 'static',
configureServer(server) {
server.middlewares.use((req, res, next) => {
if (req.url?.endsWith('.css')) {
res.setHeader('Content-Type', 'text/css');
res.end('.test { color: red; }');
return;
}
next();
});
},
},
],
test: {
browser: {
enabled: true,
headless: true,
provider: 'playwright',
instances: [{ browser: 'chromium' }, { browser: 'firefox' }, { browser: 'webkit' }],
},
include: ['**/*.test.{ts,tsx}'],
exclude: ['**/node_modules/'],
coverage: {
provider: 'istanbul',
include: ['src/**'],
},
},
});