Skip to content

Commit 7c7b529

Browse files
committed
fix: Add Uri mock to vscode mock in autoImportSettings tests
The tests were failing because the vscode mock was missing the Uri.file method that is used by the autoImportSettings implementation. Added a proper mock for vscode.Uri.file that returns an object with fsPath property.
1 parent c5361ab commit 7c7b529

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/utils/__tests__/autoImportSettings.spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ vi.mock("vscode", () => ({
99
showInformationMessage: vi.fn(),
1010
showWarningMessage: vi.fn(),
1111
},
12+
Uri: {
13+
file: vi.fn((path: string) => ({ fsPath: path })),
14+
},
1215
}))
1316

1417
vi.mock("fs/promises", () => ({

0 commit comments

Comments
 (0)