-
-
Notifications
You must be signed in to change notification settings - Fork 9.9k
Expand file tree
/
Copy pathvitest.workspace.ts
More file actions
44 lines (40 loc) · 1.26 KB
/
vitest.workspace.ts
File metadata and controls
44 lines (40 loc) · 1.26 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
import { resolve } from 'node:path';
import { defineConfig, defineWorkspace } from 'vitest/config';
export default defineWorkspace([
'.storybook/vitest.config.ts',
'addons/*/vitest.config.ts',
'frameworks/*/vitest.config.ts',
'lib/*/vitest.config.ts',
'core/vitest.config.ts',
'deprecated/*/vitest.config.ts',
'builders/*/vitest.config.ts',
'presets/*/vitest.config.ts',
'renderers/*/vitest.config.ts',
]);
/**
* CircleCI reports the wrong number of threads to Node.js, so we need to set it manually. Unit
* tests are running with the xlarge resource class, which has 8 vCPUs.
*
* @see https://jahed.dev/2022/11/20/fixing-node-js-multi-threading-on-circleci/
* @see https://vitest.dev/config/#pooloptions-threads-maxthreads
* @see https://circleci.com/docs/configuration-reference/#x86
* @see .circleci/config.yml#L214
*/
const threadCount = process.env.CI ? 7 : undefined;
export const vitestCommonConfig = defineConfig({
test: {
pool: 'threads',
poolOptions: {
threads: {
minThreads: threadCount,
maxThreads: threadCount,
},
},
passWithNoTests: true,
clearMocks: true,
setupFiles: [resolve(__dirname, './vitest-setup.ts')],
globals: true,
testTimeout: 10000,
environment: 'node',
},
});