-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathvitest.config.ts
More file actions
53 lines (51 loc) · 1.64 KB
/
Copy pathvitest.config.ts
File metadata and controls
53 lines (51 loc) · 1.64 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/// <reference types="vitest" />
import { configDefaults, defineConfig } from 'vitest/config'
import react from '@vitejs/plugin-react'
import svgr from 'vite-plugin-svgr'
import { storybookTest } from '@storybook/addon-vitest/vitest-plugin'
const isQuickStorybookMode = process.env.COVE_QUICK_TESTS === '1'
const quickStorybookExcludePatterns = ['**/*.smoke.stories.{js,jsx,ts,tsx}']
const quickStorybookExclude = [...configDefaults.exclude, ...quickStorybookExcludePatterns]
export default defineConfig({
plugins: [react({ jsxRuntime: 'automatic' }), (svgr as any)({ exportAsDefault: true })],
test: {
environment: 'jsdom',
globals: true,
setupFiles: ['./vitest.setup.ts'],
include: [
'packages/**/src/**/*.{test,spec}.{js,ts,jsx,tsx}',
'packages/**/tests/**/*.{test,spec}.{js,ts,jsx,tsx}',
'packages/**/components/**/*.{test,spec}.{js,ts,jsx,tsx}',
'packages/**/helpers/**/*.{test,spec}.{js,ts,jsx,tsx}'
],
projects: [
{
test: {
name: 'storybook',
environment: 'jsdom',
globals: true,
setupFiles: ['./vitest.setup.ts'],
...(isQuickStorybookMode ? { exclude: quickStorybookExclude } : {}),
testTimeout: 600000,
browser: {
enabled: true,
instances: [
{
browser: 'chromium',
launch: {
args: ['--disable-web-security']
}
}
],
provider: 'playwright',
headless: true
}
},
plugins: [storybookTest()]
}
]
},
define: {
global: 'globalThis'
}
})