mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-22 06:32:00 +00:00
test: make planner lanes explicit
This commit is contained in:
32
test/scripts/test-projects-lib.test.ts
Normal file
32
test/scripts/test-projects-lib.test.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { buildVitestArgs, parseTestProjectsArgs } from "../../scripts/test-projects-lib.mjs";
|
||||
|
||||
describe("test-projects args", () => {
|
||||
it("drops a pnpm passthrough separator while preserving targeted filters", () => {
|
||||
expect(parseTestProjectsArgs(["--", "src/foo.test.ts", "-t", "target"])).toEqual({
|
||||
forwardedArgs: ["src/foo.test.ts", "-t", "target"],
|
||||
watchMode: false,
|
||||
});
|
||||
});
|
||||
|
||||
it("keeps watch mode explicit without leaking the sentinel to Vitest", () => {
|
||||
expect(buildVitestArgs(["--watch", "--", "src/foo.test.ts"])).toEqual([
|
||||
"exec",
|
||||
"vitest",
|
||||
"--config",
|
||||
"vitest.projects.config.ts",
|
||||
"src/foo.test.ts",
|
||||
]);
|
||||
});
|
||||
|
||||
it("uses run mode by default", () => {
|
||||
expect(buildVitestArgs(["src/foo.test.ts"])).toEqual([
|
||||
"exec",
|
||||
"vitest",
|
||||
"run",
|
||||
"--config",
|
||||
"vitest.projects.config.ts",
|
||||
"src/foo.test.ts",
|
||||
]);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user