test: reduce test suite runtime

This commit is contained in:
N0zoM1z0
2026-07-14 21:08:27 +00:00
parent 528c05e2fa
commit 2223da1916
14 changed files with 582 additions and 207 deletions
+29 -1
View File
@@ -1,8 +1,36 @@
import { availableParallelism } from "node:os";
import { defineConfig } from "vitest/config";
const TEST_FILES = ["tests/**/*.test.ts"];
const PROCESS_CAPTURE_TEST = "tests/processCapture.test.ts";
const dualCoreProjects =
availableParallelism() === 2
? {
maxWorkers: 2,
projects: [
{
test: {
name: "parallel",
include: TEST_FILES,
exclude: [PROCESS_CAPTURE_TEST],
},
},
{
test: {
name: "process-capture",
include: [PROCESS_CAPTURE_TEST],
fileParallelism: false,
},
},
],
}
: {};
export default defineConfig({
test: {
include: ["tests/**/*.test.ts"],
include: TEST_FILES,
...dualCoreProjects,
retry: 2,
reporters: ["default", "verbose"],
coverage: {