@@ -2,6 +2,7 @@ import { SYSTEM_PROMPT } from "../system"
22import { defaultModeSlug , modes } from "../../../shared/modes"
33import * as vscode from "vscode"
44import * as fs from "fs/promises"
5+ import { toPosix } from "./utils"
56
67// Mock the fs/promises module
78jest . mock ( "fs/promises" , ( ) => ( {
@@ -89,7 +90,7 @@ describe("File-Based Custom System Prompt", () => {
8990 const fileCustomSystemPrompt = "Custom system prompt from file"
9091 // When called with utf-8 encoding, return a string
9192 mockedFs . readFile . mockImplementation ( ( filePath , options ) => {
92- if ( filePath . toString ( ) . includes ( `.roo/system-prompt-${ defaultModeSlug } ` ) && options === "utf-8" ) {
93+ if ( toPosix ( filePath ) . includes ( `.roo/system-prompt-${ defaultModeSlug } ` ) && options === "utf-8" ) {
9394 return Promise . resolve ( fileCustomSystemPrompt )
9495 }
9596 return Promise . reject ( { code : "ENOENT" } )
@@ -124,7 +125,7 @@ describe("File-Based Custom System Prompt", () => {
124125 // Mock the readFile to return content from a file
125126 const fileCustomSystemPrompt = "Custom system prompt from file"
126127 mockedFs . readFile . mockImplementation ( ( filePath , options ) => {
127- if ( filePath . toString ( ) . includes ( `.roo/system-prompt-${ defaultModeSlug } ` ) && options === "utf-8" ) {
128+ if ( toPosix ( filePath ) . includes ( `.roo/system-prompt-${ defaultModeSlug } ` ) && options === "utf-8" ) {
128129 return Promise . resolve ( fileCustomSystemPrompt )
129130 }
130131 return Promise . reject ( { code : "ENOENT" } )
0 commit comments