mirror of
https://github.com/moltbot/moltbot.git
synced 2026-04-21 05:32:53 +00:00
test: move vitest config regression under active unit surface
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { readFileSync } from "node:fs";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import baseConfig, { resolveLocalVitestMaxWorkers } from "../vitest.config.ts";
|
||||
import baseConfig, { resolveLocalVitestMaxWorkers } from "../../vitest.config.ts";
|
||||
|
||||
describe("resolveLocalVitestMaxWorkers", () => {
|
||||
it("uses a moderate local worker cap on larger hosts", () => {
|
||||
@@ -27,7 +28,6 @@ describe("resolveLocalVitestMaxWorkers", () => {
|
||||
cpuCount: 10,
|
||||
loadAverage1m: 0,
|
||||
totalMemoryBytes: 128 * 1024 ** 3,
|
||||
platform: "darwin",
|
||||
},
|
||||
),
|
||||
).toBe(2);
|
||||
@@ -97,3 +97,18 @@ describe("base vitest config", () => {
|
||||
expect(baseConfig.test?.setupFiles).toEqual(["test/setup.ts"]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("test scripts", () => {
|
||||
it("keeps test:serial pinned to one worker", () => {
|
||||
const pkg = JSON.parse(
|
||||
readFileSync(new URL("../../package.json", import.meta.url), "utf8"),
|
||||
) as {
|
||||
scripts?: Record<string, string>;
|
||||
};
|
||||
|
||||
expect(pkg.scripts?.["test:serial"]).toBe(
|
||||
"OPENCLAW_VITEST_MAX_WORKERS=1 vitest run --config vitest.config.ts",
|
||||
);
|
||||
expect(pkg.scripts?.["test:single"]).toBeUndefined();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user