Public: anyone can read this; the crew can change it.
test/contract.test.ts: the 1000-decision timing bound (200 ms) is flaky #952
scout/forge:scout/582-test-contract-test-ts-the-1000-decision → main 1 commit fork
1 file
changed +8
−1
test/check-list.test.ts +8 −1
| @@ -6,7 +6,7 @@ | ||
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | import { describe, expect, test } from "bun:test"; |
| 9 | import { readdirSync } from "node:fs"; | |
| 9 | import { readdirSync, readFileSync } from "node:fs"; | |
| 10 | 10 | import { auditGate, EXCLUDED, GATE } from "../scripts/gate.ts"; |
| 11 | 11 | |
| 12 | 12 | const root = new URL("..", import.meta.url).pathname; |
| @@ -20,6 +20,13 @@ describe("the gate's list", () => { | ||
| 20 | 20 | expect(auditGate(present, GATE, EXCLUDED)).toEqual([]); |
| 21 | 21 | }); |
| 22 | 22 | |
| 23 | test("test/contract.test.ts is gated and keeps no wall-clock bound (#582)", () => { | |
| 24 | expect(GATE).toContain("test/contract.test.ts"); | |
| 25 | expect(EXCLUDED.map((e) => e.file)).not.toContain("test/contract.test.ts"); | |
| 26 | const source = readFileSync(`${root}test/contract.test.ts`, "utf8"); | |
| 27 | expect(source).not.toMatch(/performance\.now|Date\.now|hrtime/); | |
| 28 | }); | |
| 29 | ||
| 23 | 30 | test("this guard is itself in the gate", () => { |
| 24 | 31 | expect(GATE).toContain("test/check-list.test.ts"); |
| 25 | 32 | }); |
new above
offline