-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvitest.workspace.ts
57 lines (56 loc) · 1.41 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
50
51
52
53
54
55
56
57
import { defineWorkspace } from 'vitest/config';
import react from '@vitejs/plugin-react';
import { storybookTest } from '@storybook/experimental-addon-test/vitest-plugin';
import { storybookNextJsPlugin } from '@storybook/experimental-nextjs-vite/vite-plugin';
export default defineWorkspace([
{
extends: 'vitest.config.ts',
test: {
name: 'utils test',
include: ['src/utils/**/*.test.{ts,tsx}'],
includeSource: ['src/utils/**/*.{ts,tsx}'],
},
},
{
extends: 'vitest.config.ts',
plugins: [react()],
test: {
name: 'browser test',
include: ['src/!(utils)/**/*.test.{ts,tsx}'],
browser: {
enabled: true,
instances: [
{
browser: 'chromium',
},
],
provider: 'playwright',
headless: true,
screenshotFailures: false,
},
},
},
{
extends: 'vitest.config.ts',
plugins: [
storybookTest({
storybookScript: 'pnpm storybook --ci',
}),
storybookNextJsPlugin(),
],
publicDir: '.storybook/public/',
test: {
name: 'storybook test',
browser: {
enabled: true,
// TODO: deprecateなので別の方法で書く
name: 'chromium',
provider: 'playwright',
headless: true,
screenshotFailures: false,
},
isolate: false,
setupFiles: ['./.storybook/vitest.setup.ts'],
},
},
]);