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
Merged 7h 50m ago, live in production
cf/ledger-verdict → main 0 commits
1 file
changed +6
−1
test/ledger-health.test.ts +6 −1
| @@ -18,7 +18,12 @@ beforeEach(() => { | ||
| 18 | 18 | dir = join(mkdtempSync(join(process.env.TMPDIR ?? tmpdir(), "ledger-health-")), "ledger"); |
| 19 | 19 | mkdirSync(dir); |
| 20 | 20 | }); |
| 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 | }); | |
| 22 | 27 | |
| 23 | 28 | function fixture(): string { |
| 24 | 29 | 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; |
new above
offline