fix(packages): polish cli and mcp package contracts

This commit is contained in:
t8y2
2026-05-30 17:20:38 +08:00
parent 2a696be49a
commit c467372fc8
9 changed files with 154 additions and 45 deletions
+14
View File
@@ -0,0 +1,14 @@
import assert from "node:assert/strict";
import test from "node:test";
import { formatCell, mdTable } from "../src/format.js";
test("formats markdown tables", () => {
assert.equal(mdTable(["Name", "Type"], [["local", "postgres"]]), "| Name | Type |\n| ----- | -------- |\n| local | postgres |");
});
test("formats database cell values", () => {
assert.equal(formatCell(null), "NULL");
assert.equal(formatCell(undefined), "NULL");
assert.equal(formatCell({ ok: true }), "{\"ok\":true}");
assert.equal(formatCell("hello"), "hello");
});