| 1 | import type { ApiDiff } from "@effect/api-diff/Model" |
| 2 | import { renderMarkdownReport } from "@effect/api-diff/Report" |
| 3 | import { assert, describe, it } from "@effect/vitest" |
| 4 | |
| 5 | describe("API diff report", () => { |
| 6 | it("classifies effect/http-api as unstable", () => { |
| 7 | const diff: ApiDiff = { |
| 8 | version: 1, |
| 9 | base: { ref: "base", sha: "a".repeat(40) }, |
| 10 | head: { ref: "head", sha: "b".repeat(40) }, |
| 11 | changes: [{ |
| 12 | id: "http-api-change", |
| 13 | classification: "api-added", |
| 14 | confidence: 1, |
| 15 | headApiId: "effect/http-api#endpoint#value", |
| 16 | authoritative: true |
| 17 | }] |
| 18 | } |
| 19 | |
| 20 | const report = renderMarkdownReport(diff) |
| 21 | |
| 22 | assert(report.includes("| unstable/http-api | effect/http-api | 1 |")) |
| 23 | assert(report.includes("\n## Unstable API changes\n")) |
| 24 | assert(!report.includes("\n## Stable API changes\n")) |
| 25 | }) |
| 26 | }) |