mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-01 05:00:46 +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 mockGetLoadedExtensions = vi.fn();
|
||||||
const mockInstallExtension = vi.fn();
|
const mockInstallExtension = vi.fn();
|
||||||
|
|
||||||
const createMockExtensionManager = () => ({
|
const createMockExtensionManager = () => {
|
||||||
installExtension: mockInstallExtension,
|
// Create a mock that passes instanceof ExtensionManager check
|
||||||
getLoadedExtensions: mockGetLoadedExtensions,
|
const mock = {
|
||||||
});
|
installExtension: mockInstallExtension,
|
||||||
|
getLoadedExtensions: mockGetLoadedExtensions,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Set up prototype to pass instanceof check
|
||||||
|
Object.setPrototypeOf(mock, ExtensionManager.prototype);
|
||||||
|
|
||||||
|
return mock;
|
||||||
|
};
|
||||||
|
|
||||||
describe('extensionsCommand', () => {
|
describe('extensionsCommand', () => {
|
||||||
let mockContext: CommandContext;
|
let mockContext: CommandContext;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue