chore: set test parallelism
This commit is contained in:
@@ -1,10 +1,17 @@
|
|||||||
import { defineConfig } from 'vitest/config';
|
import { defineConfig } from 'vitest/config';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
import os from 'os';
|
||||||
import react from '@vitejs/plugin-react';
|
import react from '@vitejs/plugin-react';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react()],
|
plugins: [react()],
|
||||||
test: {
|
test: {
|
||||||
|
pool: 'forks',
|
||||||
|
poolOptions: {
|
||||||
|
forks: {
|
||||||
|
maxForks: Math.max(1, Math.floor(os.cpus().length / 2)),
|
||||||
|
},
|
||||||
|
},
|
||||||
globals: true,
|
globals: true,
|
||||||
// Use jsdom for React component tests, node for main process tests
|
// Use jsdom for React component tests, node for main process tests
|
||||||
environment: 'jsdom',
|
environment: 'jsdom',
|
||||||
|
|||||||
Reference in New Issue
Block a user