Skip to content

Commit 8904429

Browse files
committed
mock workspace config for tests
1 parent e17e4a4 commit 8904429

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/__mocks__/vscode.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ const vscode = {
88
},
99
workspace: {
1010
onDidSaveTextDocument: jest.fn(),
11+
getConfiguration: jest.fn().mockImplementation((section) => ({
12+
get: jest.fn().mockReturnValue(undefined),
13+
update: jest.fn().mockResolvedValue(undefined),
14+
})),
1115
},
1216
Disposable: class {
1317
dispose() {}

src/core/__tests__/Cline.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,10 @@ jest.mock("vscode", () => {
150150
stat: jest.fn().mockResolvedValue({ type: 1 }), // FileType.File = 1
151151
},
152152
onDidSaveTextDocument: jest.fn(() => mockDisposable),
153+
getConfiguration: jest.fn().mockImplementation((section) => ({
154+
get: jest.fn().mockReturnValue(undefined),
155+
update: jest.fn().mockResolvedValue(undefined),
156+
})),
153157
},
154158
env: {
155159
uriScheme: "vscode",

0 commit comments

Comments
 (0)