Skip to main content
Glama
by microsoft
mddiff.test.ts1.23 kB
import { describe, test } from "node:test" import assert from "node:assert/strict" import { markdownDiff } from "./mddiff" describe("markdownDiff", () => { test("should return fenced code block when oldStr is undefined", () => { const result = markdownDiff(undefined, "test content", { lang: "ts" }) assert.equal(result, "\n```ts\ntest content\n```\n") }) test("should handle empty strings", () => { const result = markdownDiff("", "", { lang: "js" }) assert.equal(result, "\n```diff\n\n```\n") }) test("should show additions with + prefix", () => { const result = markdownDiff("line 1", "line 1\nline 2", { lang: "txt" }) assert.equal(result, "\n```diff\n-line 1+line 1\nline 2\n```\n") }) test("should show removals with - prefix", () => { const result = markdownDiff("line 1\nline 2", "line 1", { lang: "txt" }) assert.equal(result, "\n```diff\n-line 1\nline 2+line 1\n```\n") }) test("should handle options.ignoreWhitespace", () => { const result = markdownDiff("line 1", "line 1", { ignoreWhitespace: true, }) assert.equal(result, "\n```diff\n-line 1+line 1\n```\n") }) })

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/microsoft/genaiscript'

If you have feedback or need assistance with the MCP directory API, please join our Discord server