| 1 | /** |
| 2 | * The compatibility entry point stays a pure re-export of the canonical |
| 3 | * report. The metric is observed active installs — the substantive tests live |
| 4 | * in report-active-installs.test.ts; this file only pins that the old name |
| 5 | * keeps working and adds nothing of its own. |
| 6 | */ |
| 7 | |
| 8 | import { readFileSync } from "node:fs"; |
| 9 | import { fileURLToPath } from "node:url"; |
| 10 | |
| 11 | import { describe, expect, it } from "vitest"; |
| 12 | |
| 13 | import * as canonical from "../scripts/report-active-installs.mjs"; |
| 14 | import * as compat from "../scripts/report-dau.mjs"; |
| 15 | |
| 16 | describe("report-dau compatibility entry point", () => { |
| 17 | it("re-exports the canonical observed-active-installs report", () => { |
| 18 | for (const name of [ |
| 19 | "parseArgs", |
| 20 | "activeInstallsSql", |
| 21 | "freshnessSql", |
| 22 | "rowsFromResponse", |
| 23 | "formatReport", |
| 24 | "trendSummary", |
| 25 | "COVERAGE_CAVEATS", |
| 26 | "main", |
| 27 | ] as const) { |
| 28 | expect(compat[name], name).toBe(canonical[name]); |
| 29 | } |
| 30 | }); |
| 31 | |
| 32 | it("defines no report logic of its own", () => { |
| 33 | const ROOT = fileURLToPath(new URL("..", import.meta.url)); |
| 34 | const source = readFileSync(`${ROOT}scripts/report-dau.mjs`, "utf8"); |
| 35 | expect(source).toContain('export * from "./report-active-installs.mjs"'); |
| 36 | expect(source).not.toContain("SELECT"); |
| 37 | }); |
| 38 | }); |
| 39 |