Skip to content

Commit 088ef40

Browse files
hannesrudolphdaniel-lxs
authored andcommitted
fix: normalize path separators in tests for Windows compatibility
1 parent 205c7fd commit 088ef40

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/core/webview/__tests__/webviewMessageHandler.spec.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ vi.mock("fs/promises", () => ({
7575
import * as vscode from "vscode"
7676
import fs from "fs/promises"
7777
import * as os from "os"
78+
import * as path from "path"
7879
import * as fsUtils from "../../../utils/fs"
7980
import { getWorkspacePath } from "../../../utils/path"
8081
import { ensureSettingsDirectoryExists } from "../../../utils/globalContext"
@@ -374,7 +375,7 @@ describe("webviewMessageHandler - deleteCustomMode", () => {
374375

375376
it("should delete a project mode and its rules folder", async () => {
376377
const slug = "test-project-mode"
377-
const rulesFolderPath = `/mock/workspace/.roo/rules-${slug}`
378+
const rulesFolderPath = path.join("/mock/workspace", ".roo", `rules-${slug}`)
378379

379380
vi.mocked(mockClineProvider.customModesManager.getCustomModes).mockResolvedValue([
380381
{
@@ -399,7 +400,7 @@ describe("webviewMessageHandler - deleteCustomMode", () => {
399400
it("should delete a global mode and its rules folder", async () => {
400401
const slug = "test-global-mode"
401402
const homeDir = os.homedir()
402-
const rulesFolderPath = `${homeDir}/.roo/rules-${slug}`
403+
const rulesFolderPath = path.join(homeDir, ".roo", `rules-${slug}`)
403404

404405
vi.mocked(mockClineProvider.customModesManager.getCustomModes).mockResolvedValue([
405406
{
@@ -445,7 +446,7 @@ describe("webviewMessageHandler - deleteCustomMode", () => {
445446

446447
it("should handle errors when deleting rules folder", async () => {
447448
const slug = "test-mode-error"
448-
const rulesFolderPath = `/mock/workspace/.roo/rules-${slug}`
449+
const rulesFolderPath = path.join("/mock/workspace", ".roo", `rules-${slug}`)
449450
const error = new Error("Permission denied")
450451

451452
vi.mocked(mockClineProvider.customModesManager.getCustomModes).mockResolvedValue([

0 commit comments

Comments
 (0)