Skip to content

Commit 5077ad0

Browse files
committed
Fix test
1 parent 100ac97 commit 5077ad0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/core/prompts/sections/__tests__/custom-instructions.test.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,15 @@ describe("addCustomInstructions", () => {
106106
})
107107

108108
it("should combine all instruction types when provided", async () => {
109-
mockedFs.readFile.mockResolvedValue("mode specific rules")
109+
// Mock implementation to return different values based on the file path
110+
mockedFs.readFile.mockImplementation(((filePath: any) => {
111+
// For .clinerules-test-mode, return mode-specific rules
112+
if (filePath.toString().includes(".clinerules-test-mode")) {
113+
return Promise.resolve("mode specific rules")
114+
}
115+
// For any other read operation, return empty
116+
return Promise.reject({ code: "ENOENT" })
117+
}) as any)
110118

111119
const result = await addCustomInstructions(
112120
"mode instructions",

0 commit comments

Comments
 (0)