Skip to content

g1t/apps/web/app/lib/memory-facts.test.ts

15 lines546 bytesCodeBlame

Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.

Usage, Billing settings and prepaid AI credit; fixes from the UX audit1import assert from "node:assert/strict";
2import { test } from "node:test";
3
4import { distinctFacts } from "./memory-facts.ts";
5
6test("a fact remembered twice is shown once, the first kept", () => {
7 const facts = [
8 { id: "a", text: "Run tests with npm test." },
9 { id: "b", text: "We use pnpm everywhere" },
10 { id: "c", text: "run tests with npm test" },
11 { id: "d", text: "We use pnpm everywhere." },
12 ];
13 assert.deepEqual(distinctFacts(facts).map((fact) => fact.id), ["a", "b"]);
14 assert.deepEqual(distinctFacts([]), []);
15});