Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 21, 11:00 UTC
test(docs): cover generated Toolkits usage example
Brendan O'Leary committed
Sep 22, 2026 at 14:29 UTC
8328523ef5f712199df2498d7f1fa1f1945f1178
2 files changed
+22
-1
ts/packages/core/scripts/generate-docs.ts
+1
-1
@@ -965,7 +965,7 @@ function generateMethodMdx(method: MethodDoc): string {
965
return lines.join('\n');
966
}
967
968
-function generateClassMdx(classDoc: ClassDoc): string {
968
+export function generateClassMdx(classDoc: ClassDoc): string {
969
const lines: string[] = [];
970
971
// Build full description for frontmatter (first sentence + additional context)
ts/packages/core/test/scripts/generate-docs.test.ts
+21
@@ -7,6 +7,7 @@ import {
7
escapeTableTextForMdx,
8
escapeTextForMdx,
9
escapeTypeForMdx,
10
+ generateClassMdx,
11
isParameterRequired,
12
parseSourceSignatureTypesAtLine,
13
runTypeDocCommand,
@@ -14,6 +15,26 @@ import {
15
simplifyTypeForTable,
16
} from '../../scripts/generate-docs';
17
18
+describe('generate-docs usage examples', () => {
19
+ it('uses the public get method in the Toolkits usage block', () => {
20
+ const mdx = generateClassMdx({
21
+ name: 'Toolkits',
22
+ description: 'Toolkits API',
23
+ constructor: undefined,
24
+ methods: [],
25
+ properties: [],
26
+ });
27
+
28
+ expect(mdx).toContain(
29
+ '```typescript\n' +
30
+ "const composio = new Composio({ apiKey: 'your-api-key' });\n" +
31
+ 'const result = await composio.toolkits.get({});\n' +
32
+ '```'
33
+ );
34
+ expect(mdx).not.toContain('composio.toolkits.list()');
35
+ });
36
+});
37
+
38
describe('generate-docs type rendering', () => {
39
it('preserves inline object shapes in signatures', () => {
40
const type =