Skip to content

Commit 72911b4

Browse files
authored
Merge pull request #12 from yepcode/feature/YEP-3000
YEP-3000 Improve MCP tools filter (yc-run-js)
2 parents c616334 + 84bc9d9 commit 72911b4

2 files changed

Lines changed: 33 additions & 0 deletions

File tree

src/api/yepcodeApi.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ export class YepCodeApi {
364364
async getProcesses(
365365
params: {
366366
keywords?: string;
367+
tags?: string[];
367368
page?: number;
368369
limit?: number;
369370
} = {}

tests/api/yepcodeApi.test.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { YepCodeApi } from "../../src/api/yepcodeApi";
2+
import { ProcessesPaginatedResult } from "../../src/api/types";
3+
4+
const api = new YepCodeApi();
5+
6+
describe("YepCodeApi", () => {
7+
describe("processes", () => {
8+
it("should return a paginated list of processes", async () => {
9+
const result: ProcessesPaginatedResult = await api.getProcesses();
10+
11+
expect(result).toHaveProperty("hasNextPage");
12+
expect(result).toHaveProperty("page");
13+
expect(result).toHaveProperty("limit");
14+
expect(result).toHaveProperty("total");
15+
expect(result).toHaveProperty("data");
16+
expect(Array.isArray(result.data)).toBe(true);
17+
});
18+
19+
it("should return a paginated list of processes with a tag", async () => {
20+
const result: ProcessesPaginatedResult = await api.getProcesses({
21+
tags: ["yc-run", "dummy"],
22+
});
23+
24+
expect(result).toHaveProperty("hasNextPage");
25+
expect(result).toHaveProperty("page");
26+
expect(result).toHaveProperty("limit");
27+
expect(result).toHaveProperty("total");
28+
expect(result).toHaveProperty("data");
29+
expect(Array.isArray(result.data)).toBe(true);
30+
});
31+
});
32+
});

0 commit comments

Comments
 (0)