import assert from "node:assert/strict"; import test from "node:test"; import { buildRss, FeedService } from "../src/rss.js"; import { baseConfig, chapter } from "./helpers.js"; test("buildRss emits valid escaped RSS fields and a stable GUID", () => { const xml = buildRss([chapter], baseConfig.feed, 1700000200000); assert.match(xml, / { let calls = 0; let now = 1000; const client = { async recentLibraryChapters(limit) { calls += 1; assert.equal(limit, 25); await Promise.resolve(); return [chapter]; }, }; const service = new FeedService(client, baseConfig.feed, () => now); const [first, second] = await Promise.all([service.get(), service.get()]); assert.strictEqual(first, second); assert.equal(calls, 1); now += 301000; await service.get(); assert.equal(calls, 2); });