mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-06 14:51:08 +00:00
33 lines
969 B
TypeScript
33 lines
969 B
TypeScript
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",
|
|
]);
|
|
});
|
|
});
|