fix(review): address Copilot comments and fix CI build failure

- Copilot-instructions.md precedence: prefer .github/ path, do not
  load both when both exist
- Simplify getModel() call: remove unnecessary typeof guard since
  Config already defines getModel()
- Fix TS2352 type error in test: use proper mock cast pattern
- Add getModel to base mockConfig for test consistency

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
wenshao 2026-04-06 23:31:42 +08:00
parent fab4dc5949
commit 3ac54581a8
3 changed files with 7 additions and 9 deletions

View file

@ -34,6 +34,7 @@ describe('BundledSkillLoader', () => {
mockConfig = {
getSkillManager: vi.fn().mockReturnValue(mockSkillManager),
isCronEnabled: vi.fn().mockReturnValue(false),
getModel: vi.fn().mockReturnValue(undefined),
} as unknown as Config;
});
@ -132,9 +133,9 @@ describe('BundledSkillLoader', () => {
body: 'Review by {{model}} via Qwen Code',
});
mockSkillManager.listSkills.mockResolvedValue([skill]);
(mockConfig as Record<string, unknown>).getModel = vi
.fn()
.mockReturnValue('qwen3-coder');
(mockConfig.getModel as ReturnType<typeof vi.fn>).mockReturnValue(
'qwen3-coder',
);
const loader = new BundledSkillLoader(mockConfig);
const commands = await loader.loadCommands(signal);