mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-29 12:11:09 +00:00
refactor(skill): add null check for SkillManager and update tests
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
parent
fcc98a30d5
commit
27a9d3ec44
3 changed files with 17 additions and 1 deletions
|
|
@ -116,11 +116,20 @@ vi.mock('read-package-up', () => ({
|
|||
|
||||
vi.mock('@qwen-code/qwen-code-core', async (importOriginal) => {
|
||||
const actualServer = await importOriginal<typeof ServerConfig>();
|
||||
const SkillManagerMock = vi.fn();
|
||||
SkillManagerMock.prototype.startWatching = vi
|
||||
.fn()
|
||||
.mockResolvedValue(undefined);
|
||||
SkillManagerMock.prototype.stopWatching = vi.fn();
|
||||
SkillManagerMock.prototype.listSkills = vi.fn().mockResolvedValue([]);
|
||||
SkillManagerMock.prototype.addChangeListener = vi.fn();
|
||||
SkillManagerMock.prototype.removeChangeListener = vi.fn();
|
||||
return {
|
||||
...actualServer,
|
||||
NativeLspService: vi
|
||||
.fn()
|
||||
.mockImplementation(() => createNativeLspServiceInstance()),
|
||||
SkillManager: SkillManagerMock,
|
||||
IdeClient: {
|
||||
getInstance: vi.fn().mockResolvedValue({
|
||||
getConnectionStatus: vi.fn(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue