ReMe/integrations/dsh/tests/frontmatter.test.mjs
jinliyl 6cb81e7921
refactor(integrations): split TypeScript host plugins (#536)
* refactor(integrations): split TypeScript host plugins

* feat(integrations): refresh host compatibility and status UI

* fix(openclaw): secure status diagnostics
2026-09-11 13:06:02 +08:00

26 lines
761 B
JavaScript

import assert from "node:assert/strict";
import test from "node:test";
import { parseMarkdownFrontmatter } from "../dist/client/frontmatter.js";
test("separates top-level frontmatter from Markdown content", () => {
assert.deepEqual(
parseMarkdownFrontmatter(
"---\nname: oauth2\ndescription: delegated authorization\n framework\n---\n# OAuth 2.0",
),
{
body: "# OAuth 2.0",
entries: [
{ key: "name", value: "oauth2" },
{ key: "description", value: "delegated authorization\nframework" },
],
},
);
});
test("keeps ordinary Markdown unchanged", () => {
assert.deepEqual(parseMarkdownFrontmatter("# Journal\n\nRemember this."), {
body: "# Journal\n\nRemember this.",
entries: [],
});
});