Public: anyone can read this; the crew can change it.
Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:3kpyfa85y7 is past its budget: trevato/forge: "design check: nothing added outside the system (#2678) > every class the stylesheets define is one DESI… #3019
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/2867-sentinel-shared-01m23vygyffx5hg2f5vm8r74 → main 1 commit fork
1 file
changed +10
−4
test/design-lint.test.ts +10 −4
| @@ -16,11 +16,17 @@ const DESIGN = [ | ||
| 16 | 16 | "`.keys-only` is named after §5.", |
| 17 | 17 | ].join("\n"); |
| 18 | 18 | |
| 19 | // One walk of the tree serves both tests that read it, and a loaded check machine | |
| 20 | // gets a timeout far past the walk's cost: the verdict is the code's, not the clock's. | |
| 21 | let tree: ReturnType<typeof scan> | undefined; | |
| 22 | const treeNow = () => (tree ??= scan(".")); | |
| 23 | const SLOW = 60_000; | |
| 24 | ||
| 19 | 25 | describe("design check: nothing added outside the system (#2678)", () => { |
| 20 | 26 | test("the tree is no worse than its baseline", () => { |
| 21 | 27 | const base = JSON.parse(readFileSync("docs/design/baseline.json", "utf8")); |
| 22 | expect(compare(base, scan("."), readFileSync("docs/DESIGN.md", "utf8"))).toEqual([]); | |
| 23 | }); | |
| 28 | expect(compare(base, treeNow(), readFileSync("docs/DESIGN.md", "utf8"))).toEqual([]); | |
| 29 | }, SLOW); | |
| 24 | 30 | |
| 25 | 31 | test("counts colour literals and off-scale sizes, not on-scale ones", () => { |
| 26 | 32 | expect(countFile("a{color:#fff;background:#a1b2c3;border:1px solid rgba(0,0,0,.1)}")).toEqual({ colour: 3, size: 0 }); |
| @@ -86,6 +92,6 @@ describe("design check: nothing added outside the system (#2678)", () => { | ||
| 86 | 92 | |
| 87 | 93 | test("every class the stylesheets define is one DESIGN.md §5 names (#2700)", () => { |
| 88 | 94 | const named = new Set(documentedClasses(readFileSync("docs/DESIGN.md", "utf8"))); |
| 89 | expect(scan(".").classes.filter((k) => !named.has(k))).toEqual([]); | |
| 90 | }); | |
| 95 | expect(treeNow().classes.filter((k) => !named.has(k))).toEqual([]); | |
| 96 | }, SLOW); | |
| 91 | 97 | }); |
new above
offline