Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.

import os from 'node:os';

Comment thread
colinaaa marked this conversation as resolved.
import { defineConfig } from 'vitest/config';

export default defineConfig({
Expand Down Expand Up @@ -47,6 +49,19 @@ export default defineConfig({
NODE_ENV: 'test',
},

pool: 'forks',
poolOptions: {
forks: {
minForks: 1,
maxForks: ((cpuCount) =>
Math.floor(
cpuCount <= 32
? cpuCount / 2
: 16 + (cpuCount - 32) / 6,
Comment thread
colinaaa marked this conversation as resolved.
))(os.availableParallelism()),
},
},

projects: [
'examples/*/vitest.config.ts',
'packages/react/*/vitest.config.ts',
Expand Down
Loading