























@@ -73,23 +73,32 @@ describe("mantis before/after runtime", () => {
7373entry.args[2],
7474entry.args[3],
7575]),
76-).toEqual([
77-["git", "worktree", "add", "--detach", expect.stringContaining("baseline")],
78-["pnpm", "--dir", expect.stringContaining("baseline"), "openclaw", "qa"],
79-["git", "worktree", "add", "--detach", expect.stringContaining("candidate")],
80-["pnpm", "--dir", expect.stringContaining("candidate"), "openclaw", "qa"],
81-]);
76+).toHaveLength(4);
77+expect(commands[0]?.command).toBe("git");
78+expect(commands[0]?.args.slice(0, 3)).toEqual(["worktree", "add", "--detach"]);
79+expect(commands[0]?.args[3]).toContain("baseline");
80+expect(commands[1]?.command).toBe("pnpm");
81+expect(commands[1]?.args[0]).toBe("--dir");
82+expect(commands[1]?.args[1]).toContain("baseline");
83+expect(commands[1]?.args.slice(2, 4)).toEqual(["openclaw", "qa"]);
84+expect(commands[2]?.command).toBe("git");
85+expect(commands[2]?.args.slice(0, 3)).toEqual(["worktree", "add", "--detach"]);
86+expect(commands[2]?.args[3]).toContain("candidate");
87+expect(commands[3]?.command).toBe("pnpm");
88+expect(commands[3]?.args[0]).toBe("--dir");
89+expect(commands[3]?.args[1]).toContain("candidate");
90+expect(commands[3]?.args.slice(2, 4)).toEqual(["openclaw", "qa"]);
82918392const comparison = JSON.parse(await fs.readFile(result.comparisonPath, "utf8")) as {
8493baseline: { reproduced: boolean; status: string };
8594candidate: { fixed: boolean; status: string };
8695pass: boolean;
8796};
88-expect(comparison).toMatchObject({
89- baseline: { reproduced: true, status: "fail" },
90- candidate: { fixed: true, status: "pass" },
91- pass: true,
92-});
97+expect(comparison.baseline.reproduced).toBe(true);
98+expect(comparison.baseline.status).toBe("fail");
99+expect(comparison.candidate.fixed).toBe(true);
100+expect(comparison.candidate.status).toBe("pass");
101+expect(comparison.pass).toBe(true);
93102await expect(
94103fs.readFile(path.join(result.outputDir, "baseline", "baseline.png"), "utf8"),
95104).resolves.toBe("baseline screenshot");
@@ -156,33 +165,23 @@ describe("mantis before/after runtime", () => {
156165candidate: { expected: string; fixed: boolean };
157166pass: boolean;
158167};
159-expect(comparison).toMatchObject({
160-baseline: {
161-expected: "thread reply omits filePath attachment",
162-reproduced: true,
163-},
164-candidate: {
165-expected: "thread reply includes filePath attachment",
166-fixed: true,
167-},
168-pass: true,
169-});
168+expect(comparison.baseline.expected).toBe("thread reply omits filePath attachment");
169+expect(comparison.baseline.reproduced).toBe(true);
170+expect(comparison.candidate.expected).toBe("thread reply includes filePath attachment");
171+expect(comparison.candidate.fixed).toBe(true);
172+expect(comparison.pass).toBe(true);
170173const manifest = JSON.parse(await fs.readFile(result.manifestPath, "utf8")) as {
171174artifacts: { alt?: string; label: string }[];
172175title: string;
173176};
174177expect(manifest.title).toBe("Mantis Discord Thread Attachment QA");
175-expect(manifest.artifacts).toEqual(
176-expect.arrayContaining([
177-expect.objectContaining({
178-alt: "Baseline Discord thread reply without filePath attachment",
179-label: "Baseline missing filePath attachment",
180-}),
181-expect.objectContaining({
182-alt: "Candidate Discord thread reply with filePath attachment",
183-label: "Candidate includes filePath attachment",
184-}),
185-]),
178+const baselineArtifact = manifest.artifacts.find(
179+(artifact) => artifact.label === "Baseline missing filePath attachment",
180+);
181+expect(baselineArtifact?.alt).toBe("Baseline Discord thread reply without filePath attachment");
182+const candidateArtifact = manifest.artifacts.find(
183+(artifact) => artifact.label === "Candidate includes filePath attachment",
186184);
185+expect(candidateArtifact?.alt).toBe("Candidate Discord thread reply with filePath attachment");
187186});
188187});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。