Files
PaperClipAI/tests/runner-e2e/cleanup-verification.test.ts
T
DottaandPaperclip c22526c266 test(runner): register native Cursor interactions and cleanup proof gates
Add four explicit candidate cells with mode-specific native callback evidence. Run independent cleanup assertions before grading and preserve failures while closing every observer.

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-09-29 16:41:43 -05:00

24 lines
1011 B
TypeScript

import { expect, it } from "vitest";
import { verifyCleanupAssertions } from "./cleanup-verification.js";
it("retains a failed cleanup proof and still closes every later observer", async () => {
let closed = 0;
const result = await verifyCleanupAssertions([
async () => { throw new Error("provider still alive"); },
async () => [{ id: "no-effect", passed: false, detail: "target changed" }],
async () => { closed++; return [{ id: "observer-closed", passed: true, detail: "closed" }]; },
]);
expect(closed).toBe(1);
expect(result.errors).toHaveLength(2);
expect(result.checks).toEqual(expect.arrayContaining([
expect.objectContaining({ id: "no-effect", passed: false }),
expect.objectContaining({ id: "observer-closed", passed: true }),
]));
});
it("refuses an assertion that silently omits its proof", async () => {
const result = await verifyCleanupAssertions([async () => []]);
expect(result.errors).toHaveLength(1);
expect(result.checks[0]?.passed).toBe(false);
});