Skip to content

Commit 3e1e411

Browse files
committed
fix: add missing vscode mock exports for Uri and RelativePattern in tests
1 parent d66bacf commit 3e1e411

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

src/core/task/__tests__/Task.spec.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ vi.mock("vscode", () => {
116116
stat: vi.fn().mockResolvedValue({ type: 1 }), // FileType.File = 1
117117
},
118118
onDidSaveTextDocument: vi.fn(() => mockDisposable),
119+
onDidChangeWorkspaceFolders: vi.fn(() => mockDisposable),
119120
getConfiguration: vi.fn(() => ({ get: (key: string, defaultValue: any) => defaultValue })),
120121
},
121122
env: {
@@ -127,6 +128,23 @@ vi.mock("vscode", () => {
127128
from: vi.fn(),
128129
},
129130
TabInputText: vi.fn(),
131+
Uri: {
132+
file: vi.fn((path: string) => ({
133+
scheme: "file",
134+
authority: "",
135+
path,
136+
query: "",
137+
fragment: "",
138+
fsPath: path,
139+
with: vi.fn(),
140+
toJSON: vi.fn(),
141+
})),
142+
parse: vi.fn(),
143+
},
144+
RelativePattern: vi.fn((base: string, pattern: string) => ({
145+
base,
146+
pattern,
147+
})),
130148
}
131149
})
132150

src/services/mcp/__tests__/McpHub.spec.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,23 @@ vi.mock("vscode", () => ({
6565
Disposable: {
6666
from: vi.fn(),
6767
},
68+
Uri: {
69+
file: vi.fn((path: string) => ({
70+
scheme: "file",
71+
authority: "",
72+
path,
73+
query: "",
74+
fragment: "",
75+
fsPath: path,
76+
with: vi.fn(),
77+
toJSON: vi.fn(),
78+
})),
79+
parse: vi.fn(),
80+
},
81+
RelativePattern: vi.fn((base: string, pattern: string) => ({
82+
base,
83+
pattern,
84+
})),
6885
}))
6986
vi.mock("fs/promises")
7087
vi.mock("../../../core/webview/ClineProvider")

0 commit comments

Comments
 (0)