mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-30 12:40:44 +00:00
test: 修复 extensionsCommand 测试
- 更新 mock ExtensionManager 以通过 instanceof 检查 - 确保测试与新的错误处理逻辑兼容
This commit is contained in:
parent
2d5088e58f
commit
8c693ba738
1 changed files with 12 additions and 4 deletions
|
|
@ -35,10 +35,18 @@ const mockGetExtensions = vi.fn();
|
|||
const mockGetLoadedExtensions = vi.fn();
|
||||
const mockInstallExtension = vi.fn();
|
||||
|
||||
const createMockExtensionManager = () => ({
|
||||
installExtension: mockInstallExtension,
|
||||
getLoadedExtensions: mockGetLoadedExtensions,
|
||||
});
|
||||
const createMockExtensionManager = () => {
|
||||
// Create a mock that passes instanceof ExtensionManager check
|
||||
const mock = {
|
||||
installExtension: mockInstallExtension,
|
||||
getLoadedExtensions: mockGetLoadedExtensions,
|
||||
};
|
||||
|
||||
// Set up prototype to pass instanceof check
|
||||
Object.setPrototypeOf(mock, ExtensionManager.prototype);
|
||||
|
||||
return mock;
|
||||
};
|
||||
|
||||
describe('extensionsCommand', () => {
|
||||
let mockContext: CommandContext;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue