forked from solana-foundation/explorer
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvitest.workspace.ts
More file actions
59 lines (57 loc) · 2.02 KB
/
vitest.workspace.ts
File metadata and controls
59 lines (57 loc) · 2.02 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
54
55
56
57
58
59
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { storybookTest } from '@storybook/addon-vitest/vitest-plugin';
import { defineWorkspace } from 'vitest/config';
const dirname = typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url));
// More info at: https://storybook.js.org/docs/writing-tests/test-addon
export default defineWorkspace([
{
extends: 'vite.config.mts',
test: {
name: 'specs',
setupFiles: ['./test-setup.specs.ts'],
},
},
{
extends: 'vite.config.mts',
optimizeDeps: {
include: [
'vite-plugin-node-polyfills/shims/buffer',
'vite-plugin-node-polyfills/shims/global',
'vite-plugin-node-polyfills/shims/process',
],
},
plugins: [
// The plugin will run tests for the stories defined in your Storybook config
// See options at: https://storybook.js.org/docs/writing-tests/test-addon#storybooktest
storybookTest({
configDir: path.join(dirname, '.storybook'),
tags: {
include: ['test'],
exclude: ['experimental'],
},
}),
],
test: {
name: 'storybook',
browser: {
enabled: true,
headless: true,
// Firefox is disabled in CI due to flaky connection timeouts
instances: process.env.CI
? [{ browser: 'chromium' }]
: [{ browser: 'chromium' }, { browser: 'firefox' }],
provider: 'playwright',
isolate: true,
connectTimeout: 30000,
},
setupFiles: ['./test-setup.ts', './.storybook/vitest.setup.ts'],
testTimeout: 15000,
hookTimeout: 30000,
retry: 1,
sequence: {
concurrent: false,
},
},
},
]);