import assert from "node:assert/strict"; import { describe, it } from "node:test"; import { formatReceiptAlert } from "../src/notify/ntfy.js"; describe("formatReceiptAlert", () => { it("includes reason, messageId, and body", () => { const text = formatReceiptAlert({ reason: "parse failed", messageId: "abc#1", kind: "grab.ereceipt.ride", message: { from: "Grab ", subject: "Your Grab E-Receipt", body: "Total Paid\nRp1.000", html: "x", }, }); assert.match(text, /reason: parse failed/); assert.match(text, /messageId: abc#1/); assert.match(text, /Total Paid/); assert.match(text, /html \(length\)/); }); });