62 lines
1.9 KiB
TypeScript
62 lines
1.9 KiB
TypeScript
/**
|
|
* Documentation tools tests
|
|
*/
|
|
|
|
import { describe, test, expect, beforeEach } from "bun:test";
|
|
import { registerDocsTools } from "../../../../src/tools/programming/docs.js";
|
|
import { callTool } from "../../../helpers/tool-helper.js";
|
|
|
|
describe("Documentation Tools", () => {
|
|
beforeEach(() => {
|
|
registerDocsTools();
|
|
});
|
|
|
|
test("should get TypeScript documentation", async () => {
|
|
const result = await callTool("docs_typescript", {});
|
|
|
|
expect(result.content[0].text).toContain("TypeScript Documentation");
|
|
expect(result.content[0].text).toContain("typescriptlang.org");
|
|
});
|
|
|
|
test("should get TypeScript documentation with topic", async () => {
|
|
const result = await callTool("docs_typescript", {
|
|
topic: "generics",
|
|
});
|
|
|
|
expect(result.content[0].text).toContain("TypeScript Documentation");
|
|
expect(result.content[0].text).toContain("generics");
|
|
});
|
|
|
|
test("should get Vue3 documentation", async () => {
|
|
const result = await callTool("docs_vue3", {});
|
|
|
|
expect(result.content[0].text).toContain("Vue 3 Documentation");
|
|
expect(result.content[0].text).toContain("vuejs.org");
|
|
});
|
|
|
|
test("should get Vue3 documentation with topic", async () => {
|
|
const result = await callTool("docs_vue3", {
|
|
topic: "composition",
|
|
});
|
|
|
|
expect(result.content[0].text).toContain("Vue 3 Documentation");
|
|
expect(result.content[0].text).toContain("composition");
|
|
});
|
|
|
|
test("should get Bun documentation", async () => {
|
|
const result = await callTool("docs_bun", {});
|
|
|
|
expect(result.content[0].text).toContain("Bun Documentation");
|
|
expect(result.content[0].text).toContain("bun.sh");
|
|
});
|
|
|
|
test("should get Bun documentation with topic", async () => {
|
|
const result = await callTool("docs_bun", {
|
|
topic: "runtime",
|
|
});
|
|
|
|
expect(result.content[0].text).toContain("Bun Documentation");
|
|
expect(result.content[0].text).toContain("runtime");
|
|
});
|
|
});
|