mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
fix: add missing Uri and RelativePattern exports to VSCode mock in MCP tests
- Added Uri.file mock function to return proper Uri-like objects - Added RelativePattern mock constructor - Fixes test failures where McpHub.ts uses vscode.Uri.file() and vscode.RelativePattern - All MCP tests now pass (24/24)
This commit is contained in:
parent
36ff031d72
commit
ebcb23d321
1 changed files with 16 additions and 1 deletions
|
|
@ -62,6 +62,22 @@ vi.mock("vscode", () => ({
|
|||
dispose: vi.fn(),
|
||||
}),
|
||||
},
|
||||
Uri: {
|
||||
file: vi.fn((path: string) => ({
|
||||
scheme: "file",
|
||||
authority: "",
|
||||
path: path,
|
||||
query: "",
|
||||
fragment: "",
|
||||
fsPath: path,
|
||||
with: vi.fn(),
|
||||
toJSON: vi.fn(),
|
||||
})),
|
||||
},
|
||||
RelativePattern: vi.fn().mockImplementation((base: string, pattern: string) => ({
|
||||
base,
|
||||
pattern,
|
||||
})),
|
||||
Disposable: {
|
||||
from: vi.fn(),
|
||||
},
|
||||
|
|
@ -93,7 +109,6 @@ describe("McpHub", () => {
|
|||
// Mock console.error to suppress error messages during tests
|
||||
console.error = vi.fn()
|
||||
|
||||
|
||||
const mockUri: Uri = {
|
||||
scheme: "file",
|
||||
authority: "",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue