mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-14 22:54:01 -06:00
ea2c6a63c9
* refactor(scripts): adopt shared scaffolding * fix(scripts): satisfy strict tooling checks * fix(scripts): preserve scaffolding contracts
36 lines
1.2 KiB
TypeScript
36 lines
1.2 KiB
TypeScript
// Verify tests cover verify script behavior.
|
|
import { spawnSync } from "node:child_process";
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
function runVerify(...args: string[]) {
|
|
return spawnSync(process.execPath, ["scripts/verify.mjs", ...args], {
|
|
cwd: process.cwd(),
|
|
encoding: "utf8",
|
|
});
|
|
}
|
|
|
|
describe("scripts/verify", () => {
|
|
it("prints help without running verify stages", () => {
|
|
const result = runVerify("--help");
|
|
|
|
expect(result.status).toBe(0);
|
|
expect(result.stderr).toBe("");
|
|
expect(result.stdout).toContain("Usage: node scripts/verify.mjs");
|
|
expect(result.stdout).not.toContain("CRABBOX_PHASE:");
|
|
expect(result.stdout).not.toContain("[verify]");
|
|
});
|
|
|
|
it("rejects unknown args before running verify stages", () => {
|
|
for (const args of [["--bogus"], ["bogus", "--help"]]) {
|
|
const result = runVerify(...args);
|
|
|
|
expect(result.status).toBe(2);
|
|
expect(result.stdout).toBe("");
|
|
expect(result.stderr).toContain(`unknown argument: ${args[0]}`);
|
|
expect(result.stderr).toContain("Usage: node scripts/verify.mjs");
|
|
expect(result.stderr).not.toContain("CRABBOX_PHASE:");
|
|
expect(result.stderr).not.toContain("[verify]");
|
|
}
|
|
});
|
|
});
|