-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathvitest.workspace.ts
49 lines (48 loc) · 1.49 KB
/
vitest.workspace.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import path from 'path'
import { defineWorkspace } from 'vitest/config'
import { storybookTest } from '@storybook/experimental-addon-test/vitest-plugin'
import { storybookVuePlugin } from '@storybook/vue3-vite/vite-plugin'
import AutoImportFunctions from 'unplugin-auto-import/vite'
import AutoImportComponents from 'unplugin-vue-components/vite'
// More info at: https://storybook.js.org/docs/writing-tests/vitest-plugin
export default defineWorkspace([
'vitest.config.ts',
{
extends: 'vite.config.ts',
plugins: [
// See options at: https://storybook.js.org/docs/writing-tests/vitest-plugin#storybooktest
storybookTest({ configDir: '.storybook' }),
storybookVuePlugin(),
AutoImportFunctions ({ imports: [
'vue',
'vee-validate',
'vue-router',
'pinia',
], dts: '.storybook/auto-imports.d.ts',
}),
AutoImportComponents({
dirs: ['src/components'],
dts: '.storybook/components.d.ts',
}),
],
resolve: {
alias: {
'~': path.resolve(__dirname, './src'),
'@': path.resolve(__dirname, './src'),
},
},
test: {
name: 'storybook',
browser: {
enabled: true,
headless: true,
name: 'chromium',
provider: 'playwright',
},
// environment: 'happy-dom',
// Make sure to adjust this pattern to match your stories files.
include: ['**/*.stories.?(m)[jt]s?(x)'],
setupFiles: ['.storybook/vitest.setup.ts'],
},
},
])