test: dedupe and optimize test suites

This commit is contained in:
Peter Steinberger
2026-02-19 15:18:50 +00:00
parent b0e55283d5
commit a1cb700a05
80 changed files with 2627 additions and 2962 deletions

View File

@@ -63,12 +63,15 @@ describe("runBootOnce", () => {
await fs.rm(workspaceDir, { recursive: true, force: true });
});
it("skips when BOOT.md is empty", async () => {
it.each([
{ title: "empty", content: " \n", reason: "empty" as const },
{ title: "whitespace-only", content: "\n\t ", reason: "empty" as const },
])("skips when BOOT.md is $title", async ({ content, reason }) => {
const workspaceDir = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-boot-"));
await fs.writeFile(path.join(workspaceDir, "BOOT.md"), " \n", "utf-8");
await fs.writeFile(path.join(workspaceDir, "BOOT.md"), content, "utf-8");
await expect(runBootOnce({ cfg: {}, deps: makeDeps(), workspaceDir })).resolves.toEqual({
status: "skipped",
reason: "empty",
reason,
});
expect(agentCommand).not.toHaveBeenCalled();
await fs.rm(workspaceDir, { recursive: true, force: true });