Skip to content

Commit 35b686d

Browse files
committed
test(session): 更新测试以包括提示和资源计数信息
- 在 getMcpStatus 的断言中添加 promptCount、prompts、resourceCount 和 resources 字段 - 确保各状态对象包含完整的提示和资源数组信息 - 维护现有工具和连接状态的正确性 - 扩展测试覆盖,支持提示和资源相关的状态字段验证
1 parent 587a602 commit 35b686d

1 file changed

Lines changed: 26 additions & 2 deletions

File tree

src/tests/session.test.ts

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,17 @@ rl.on("line", (line) => {
410410
const initPromise = manager.initMcpServers({ smoke: { command: process.execPath, args: [serverPath] } });
411411

412412
assert.deepEqual(manager.getMcpStatus(), [
413-
{ name: "smoke", status: "starting", connected: false, toolCount: 0, tools: [] },
413+
{
414+
name: "smoke",
415+
status: "starting",
416+
connected: false,
417+
toolCount: 0,
418+
tools: [],
419+
promptCount: 0,
420+
prompts: [],
421+
resourceCount: 0,
422+
resources: [],
423+
},
414424
]);
415425

416426
await initPromise;
@@ -422,6 +432,10 @@ rl.on("line", (line) => {
422432
connected: true,
423433
toolCount: 2,
424434
tools: ["mcp__smoke__echo", "mcp__smoke__count"],
435+
promptCount: 0,
436+
prompts: [],
437+
resourceCount: 0,
438+
resources: [],
425439
},
426440
]);
427441
const mcpManager = (manager as any).mcpManager;
@@ -457,7 +471,17 @@ test("SessionManager reports configured MCP servers as starting before initializ
457471
});
458472

459473
assert.deepEqual(manager.getMcpStatus(), [
460-
{ name: "playwright", status: "starting", connected: false, toolCount: 0, tools: [] },
474+
{
475+
name: "playwright",
476+
status: "starting",
477+
connected: false,
478+
toolCount: 0,
479+
tools: [],
480+
promptCount: 0,
481+
prompts: [],
482+
resourceCount: 0,
483+
resources: [],
484+
},
461485
]);
462486
});
463487

0 commit comments

Comments
 (0)