import assert from "node:assert/strict"; import test from "node:test"; import { dateFromInput, plainTextToNoteHtml } from "../src/apple-events.js"; test("plainTextToNoteHtml escapes input and preserves line breaks", () => { assert.equal( plainTextToNoteHtml("R&D ", 'First\n"second"'), "

R&D <today>

First
"second"
", ); }); test("dateFromInput accepts valid datetimes and rejects invalid input", () => { assert.equal(dateFromInput("2026-05-26T10:00:00-04:00", "start").toISOString(), "2026-05-26T14:00:00.000Z"); assert.throws(() => dateFromInput("not-a-date", "start"), /valid ISO-8601/); });