Skip to content

Commit c74bd6b

Browse files
daniel-lxshannesrudolph
authored andcommitted
Fix Windows path handling in CustomModesManager tests
- Make mockWorkspacePath and mockRoomodes path construction consistent - Use path.join() to properly construct mockRoomodes path - This should fix the Windows test failures related to path mismatches
1 parent 147ca50 commit c74bd6b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/core/config/__tests__/CustomModesManager.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ describe("CustomModesManager", () => {
4848
// Use path.sep to ensure correct path separators for the current platform
4949
const mockStoragePath = `${path.sep}mock${path.sep}settings`
5050
const mockSettingsPath = path.join(mockStoragePath, "settings", GlobalFileNames.customModes)
51-
const mockRoomodes = `${path.sep}mock${path.sep}workspace${path.sep}.roomodes`
51+
const mockWorkspacePath = path.resolve("/mock/workspace")
52+
const mockRoomodes = path.join(mockWorkspacePath, ".roomodes")
5253

5354
beforeEach(() => {
5455
mockOnUpdate = vi.fn()
@@ -64,7 +65,7 @@ describe("CustomModesManager", () => {
6465
},
6566
} as unknown as vscode.ExtensionContext
6667

67-
const mockWorkspacePath = path.resolve("/mock/workspace")
68+
// mockWorkspacePath is now defined at the top level
6869
mockWorkspaceFolders = [{ uri: { fsPath: mockWorkspacePath } }]
6970
;(vscode.workspace as any).workspaceFolders = mockWorkspaceFolders
7071
;(vscode.workspace.onDidSaveTextDocument as Mock).mockReturnValue({ dispose: vi.fn() })

0 commit comments

Comments
 (0)