import assert from "node:assert/strict"; import { test } from "node:test"; import { compose, invited } from "../mail.ts"; test("an email has a text and an escaped HTML body with its link", () => { const message = compose("noreply@useref.dev", invited("eve@example.com", "", "Aman", "https://useref.dev/invite/abc")); assert.equal(message.to, "eve@example.com"); assert.deepEqual(message.from, { email: "noreply@useref.dev", name: "refs" }); assert.match(message.text!, /^Join : https:\/\/useref\.dev\/invite\/abc$/m); assert.match(message.html!, /]*>Join <acme><\/a>/); assert.doesNotMatch(message.html!, //); });