fix(core): 修复测试用例以匹配最新实现

- todo-manager.test: 修复空日期字符串导致的 Invalid time value 错误
- config-loader.test: 更新测试以匹配简化后的配置加载逻辑
- mcp/config.test: 修复配置路径匹配问题
- task.test/task-extended.test: 添加缺失的 agentEventEmitter mock
- presets/index.test: 更新预设 Agent 数量和 maxSteps 测试
- agent.test: 添加缺失的 mock 函数并修正模式切换测试
- 删除过时的 session/manager.test 和 storage.test (使用已废弃的 API)
This commit is contained in:
2025-12-16 22:33:46 +08:00
parent 66ad1a1ec9
commit eb80b2c9e6
9 changed files with 74 additions and 932 deletions
@@ -14,7 +14,7 @@ import {
describe('Agent Presets - 预设 Agent', () => {
describe('presetAgents 集合', () => {
it('包含所有预设 Agent', () => {
expect(Object.keys(presetAgents)).toHaveLength(7); // includes summary agent
expect(Object.keys(presetAgents)).toHaveLength(8); // includes summary and guide agent
});
it('包含 general Agent', () => {
@@ -67,7 +67,7 @@ describe('Agent Presets - 预设 Agent', () => {
it('返回正确数量', () => {
const names = getPresetAgentNames();
expect(names).toHaveLength(7); // general, explore, code-review, frontend, backend, vision, summary
expect(names).toHaveLength(8); // general, explore, code-reviewer, build, plan, vision, summary, guide
});
});
@@ -123,9 +123,9 @@ describe('Agent Presets - 预设 Agent', () => {
expect(generalAgent.tools?.noTask).toBe(true);
});
it(' maxSteps 限制', () => {
expect(generalAgent.maxSteps).toBeDefined();
expect(generalAgent.maxSteps).toBeGreaterThan(0);
it('使用默认 maxSteps(未设置具体值)', () => {
// generalAgent 不设置 maxSteps,使用系统默认值
expect(generalAgent.maxSteps).toBeUndefined();
});
});