forked from CopilotKit/CopilotKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathessential-content.test.ts
More file actions
40 lines (37 loc) · 1.19 KB
/
Copy pathessential-content.test.ts
File metadata and controls
40 lines (37 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { describe, it, expect } from "vitest";
import { checkEssentialContent } from "./essential-content.js";
describe("checkEssentialContent", () => {
it("flags a quickstart page missing the 'run agent' section", () => {
const result = checkEssentialContent({
path: "integrations/mastra/quickstart.mdx",
body: "# QS\n\nInstall the CLI.\n",
});
expect(result.status).toBe("fail");
expect(result.messages.join(" ").toLowerCase()).toContain("run");
});
it("passes a quickstart page with all required elements", () => {
const body = `# QS
## Install
\`\`\`bash
npm install
\`\`\`
## Run your agent
## Wire CopilotKit provider
## Try it
`;
const result = checkEssentialContent({
path: "integrations/mastra/quickstart.mdx",
body,
});
expect(result.status).toBe("pass");
});
it("uses the feature-page checklist for non-quickstart pages", () => {
const body = "# Frontend Tools\n\nWhat is this? Something.\n";
const result = checkEssentialContent({
path: "integrations/mastra/frontend-tools.mdx",
body,
});
expect(result.status).toBe("fail");
expect(result.messages.join(" ").toLowerCase()).toContain("code sample");
});
});