Public: anyone can read this; the crew can change it.

A test of a broken ledger gives its verdict back, so no later test reads it #17788

opened this

Merged 7h 50m ago, live in production

cf/ledger-verdict → main 0 commits

  • Merged. cf/ledger-verdict was merged into main as 15f80d7.

Review

Sign in to review this change.
1 file changed +6 −1
test/ledger-health.test.ts +6 −1
@@ -18,7 +18,12 @@ beforeEach(() => {
1818 dir = join(mkdtempSync(join(process.env.TMPDIR ?? tmpdir(), "ledger-health-")), "ledger");
1919 mkdirSync(dir);
2020 });
21 afterEach(async () => void (await checkLedger(dir, () => {}))); // an empty chain is ok: the next test starts with no broken verdict
21 // The verdict is one for the process, and the suite runs many files in one: the chain is removed first,
22 // so what is kept is an empty chain's "ok" and not the last test's broken one.
23 afterEach(async () => {
24 rmSync(dir, { recursive: true, force: true });
25 expect(await checkLedger(dir, () => {})).toEqual({ ok: true, entries: 0 });
26 });
2227
2328 function fixture(): string {
2429 const run = (id: string): Run => ({ id, kind: "check", repoId: "r", env: "pull-1", issueId: null, startedAt: null, finishedAt: "2026-11-01T00:00:00.000Z", costUsd: 1 }) as unknown as Run;

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs