Skip to main content
Glama
communication.test.ts1.66 kB
import { describe, it, expect } from "vitest"; import { generateCommitMessageHandler, generatePRDescriptionHandler, updateChangelogHandler, } from "./communication.js"; describe("Communication Tools", () => { describe("generateCommitMessageHandler", () => { it("should generate semantic commit", () => { const result = generateCommitMessageHandler({ type: "feat", scope: "auth", description: "add login", breaking: true, }); expect(result.content[0].text).toContain("feat(auth)!: add login"); expect(result.content[0].text).toContain("BREAKING CHANGE"); }); }); describe("generatePRDescriptionHandler", () => { it("should generate PR description", () => { const result = generatePRDescriptionHandler({ title: "Add Login", type: "feature", summary: "Adds login page", changes: ["added login.ts", "updated auth"], }); expect(result.content[0].text).toContain("# Add Login"); expect(result.content[0].text).toContain("✨ New feature"); expect(result.content[0].text).toContain("- added login.ts"); }); }); describe("updateChangelogHandler", () => { it("should generate changelog entry", () => { const result = updateChangelogHandler({ version: "1.2.0", added: ["New feature X"], fixed: ["Bug Y"], }); expect(result.content[0].text).toContain("## [1.2.0]"); expect(result.content[0].text).toContain("### Added"); expect(result.content[0].text).toContain("- New feature X"); expect(result.content[0].text).toContain("### Fixed"); }); }); });

Latest Blog Posts

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/millsydotdev/Code-MCP'

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