Skip to content

Commit 2cf5c25

Browse files
committed
fix: use path.join() in tests to handle Windows path separators correctly
1 parent d8590c5 commit 2cf5c25

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/services/marketplace/__tests__/SimpleInstaller.spec.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,11 @@ describe("SimpleInstaller", () => {
228228
await installer.removeItem(mockModeItem, { target: "project" })
229229

230230
expect(mockCustomModesManager.deleteCustomMode).toHaveBeenCalledWith("test")
231-
expect(fileExistsAtPath).toHaveBeenCalledWith("/test/workspace/.roo/rules-test")
232-
expect(mockFs.rm).toHaveBeenCalledWith("/test/workspace/.roo/rules-test", { recursive: true, force: true })
231+
expect(fileExistsAtPath).toHaveBeenCalledWith(path.join("/test/workspace", ".roo", "rules-test"))
232+
expect(mockFs.rm).toHaveBeenCalledWith(path.join("/test/workspace", ".roo", "rules-test"), {
233+
recursive: true,
234+
force: true,
235+
})
233236
})
234237

235238
it("should handle global mode removal with rules cleanup", async () => {
@@ -243,8 +246,11 @@ describe("SimpleInstaller", () => {
243246
await installer.removeItem(mockModeItem, { target: "global" })
244247

245248
expect(mockCustomModesManager.deleteCustomMode).toHaveBeenCalledWith("test")
246-
expect(fileExistsAtPath).toHaveBeenCalledWith("/home/user/.roo/rules-test")
247-
expect(mockFs.rm).toHaveBeenCalledWith("/home/user/.roo/rules-test", { recursive: true, force: true })
249+
expect(fileExistsAtPath).toHaveBeenCalledWith(path.join("/home/user", ".roo", "rules-test"))
250+
expect(mockFs.rm).toHaveBeenCalledWith(path.join("/home/user", ".roo", "rules-test"), {
251+
recursive: true,
252+
force: true,
253+
})
248254
})
249255

250256
it("should handle case when rules folder does not exist", async () => {
@@ -258,7 +264,7 @@ describe("SimpleInstaller", () => {
258264
await installer.removeItem(mockModeItem, { target: "project" })
259265

260266
expect(mockCustomModesManager.deleteCustomMode).toHaveBeenCalledWith("test")
261-
expect(fileExistsAtPath).toHaveBeenCalledWith("/test/workspace/.roo/rules-test")
267+
expect(fileExistsAtPath).toHaveBeenCalledWith(path.join("/test/workspace", ".roo", "rules-test"))
262268
expect(mockFs.rm).not.toHaveBeenCalled()
263269
})
264270

0 commit comments

Comments
 (0)