Open History to see the last commit
1import { assert, describe, it } from "@effect/vitest";
2
3import { countRestyleFindings, evaluateCeiling } from "./lint-restyle-ceiling.ts";
4
5describe("lint-restyle-ceiling", () => {
6 it("counts only no-restyle diagnostics", () => {
7 const count = countRestyleFindings({
8 diagnostics: [
9 { code: "shadcn(no-restyle)" },
10 { code: "react(refs)" },
11 { code: "shadcn(no-restyle)" },
12 ],
13 });
14 assert.strictEqual(count, 2);
15 });
16
17 it("fails above the ceiling and passes at or below it", () => {
18 assert.isFalse(evaluateCeiling(11, 10).ok);
19 assert.isTrue(evaluateCeiling(10, 10).ok);
20 const below = evaluateCeiling(7, 10);
21 assert.isTrue(below.ok);
22 assert.include(below.message, "Lower RESTYLE_CEILING");
23 });
24});