test: reduce test suite runtime
This commit is contained in:
+29
-1
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user