Files
openclaw/test/scripts/docker-e2e-helper-cli.test.ts
2026-05-27 06:04:53 +02:00

37 lines
1.1 KiB
TypeScript

import { spawnSync } from "node:child_process";
import { describe, expect, it } from "vitest";
function runHelper(script: string, ...args: string[]) {
return spawnSync(process.execPath, [script, ...args], {
cwd: process.cwd(),
encoding: "utf8",
env: {
...process.env,
GH_FORCE_TTY: "0",
NO_COLOR: "1",
},
});
}
describe("Docker E2E helper CLIs", () => {
it("prints timings help without treating --help as an artifact path", () => {
const result = runHelper("scripts/docker-e2e-timings.mjs", "--help");
expect(result.status).toBe(0);
expect(result.stderr).toBe("");
expect(result.stdout).toContain(
"Usage: node scripts/docker-e2e-timings.mjs <summary.json|lane-timings.json>",
);
});
it("prints rerun help without detecting the GitHub repository", () => {
const result = runHelper("scripts/docker-e2e-rerun.mjs", "--help");
expect(result.status).toBe(0);
expect(result.stderr).toBe("");
expect(result.stdout).toContain(
"node scripts/docker-e2e-rerun.mjs <run-id|summary.json|failures.json>",
);
});
});