Initial local macOS MCP service
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
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 <today>", 'First\n"second"'),
|
||||
"<h1>R&D <today></h1><div>First<br>"second"</div>",
|
||||
);
|
||||
});
|
||||
|
||||
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/);
|
||||
});
|
||||
Reference in New Issue
Block a user