* Add OpenCode converter coverage and specs * Add Codex target support and spec docs * Generate Codex command skills and refresh spec docs * Add global Codex install path * fix: harden plugin path loading and codex descriptions * feat: ensure codex agents block on convert/install * docs: clarify target branch usage for review * chore: prep npm package metadata and release notes * docs: mention opencode and codex in changelog * docs: update CLI usage and remove stale todos * feat: install from GitHub with global outputs
21 lines
730 B
TypeScript
21 lines
730 B
TypeScript
import { describe, expect, test } from "bun:test"
|
|
import { formatFrontmatter, parseFrontmatter } from "../src/utils/frontmatter"
|
|
|
|
describe("frontmatter", () => {
|
|
test("parseFrontmatter returns body when no frontmatter", () => {
|
|
const raw = "Hello\nWorld"
|
|
const result = parseFrontmatter(raw)
|
|
expect(result.data).toEqual({})
|
|
expect(result.body).toBe(raw)
|
|
})
|
|
|
|
test("formatFrontmatter round trips", () => {
|
|
const body = "Body text"
|
|
const formatted = formatFrontmatter({ name: "agent", description: "Test" }, body)
|
|
const parsed = parseFrontmatter(formatted)
|
|
expect(parsed.data.name).toBe("agent")
|
|
expect(parsed.data.description).toBe("Test")
|
|
expect(parsed.body.trim()).toBe(body)
|
|
})
|
|
})
|