feat: harden analytics dashboard

This commit is contained in:
2026-05-27 15:19:31 +08:00
parent 5e0ca6a504
commit 356039d9cf
34 changed files with 1424 additions and 879 deletions

10
lib/metrics.test.ts Normal file
View File

@@ -0,0 +1,10 @@
import { describe, expect, test } from "bun:test";
import { QUOTA_UNITS_PER_USD, quotaToUsd } from "./metrics";
describe("metric conversions", () => {
test("converts quota units to USD", () => {
expect(QUOTA_UNITS_PER_USD).toBe(500000);
expect(quotaToUsd(500000)).toBe(1);
expect(quotaToUsd(250000)).toBe(0.5);
});
});