fix: skip flaky Windows test in custom-system-prompt.spec.ts (#8023)

Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com>
Co-authored-by: Roo Code <roomote@roocode.com>
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
This commit is contained in:
roomote[bot] 2025-09-16 13:47:56 -04:00 committed by GitHub
parent 297c85ff87
commit 6d8de53c8f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -83,38 +83,42 @@ describe("File-Based Custom System Prompt", () => {
mockedFs.readFile.mockRejectedValue({ code: "ENOENT" })
})
it("should use default generation when no file-based system prompt is found", async () => {
const customModePrompts = {
[defaultModeSlug]: {
roleDefinition: "Test role definition",
},
}
// Skipped on Windows due to timeout/flake issues
it.skipIf(process.platform === "win32")(
"should use default generation when no file-based system prompt is found",
async () => {
const customModePrompts = {
[defaultModeSlug]: {
roleDefinition: "Test role definition",
},
}
const prompt = await SYSTEM_PROMPT(
mockContext,
"test/path", // Using a relative path without leading slash
false, // supportsComputerUse
undefined, // mcpHub
undefined, // diffStrategy
undefined, // browserViewportSize
defaultModeSlug, // mode
customModePrompts, // customModePrompts
undefined, // customModes
undefined, // globalCustomInstructions
undefined, // diffEnabled
undefined, // experiments
true, // enableMcpServerCreation
undefined, // language
undefined, // rooIgnoreInstructions
undefined, // partialReadsEnabled
)
const prompt = await SYSTEM_PROMPT(
mockContext,
"test/path", // Using a relative path without leading slash
false, // supportsComputerUse
undefined, // mcpHub
undefined, // diffStrategy
undefined, // browserViewportSize
defaultModeSlug, // mode
customModePrompts, // customModePrompts
undefined, // customModes
undefined, // globalCustomInstructions
undefined, // diffEnabled
undefined, // experiments
true, // enableMcpServerCreation
undefined, // language
undefined, // rooIgnoreInstructions
undefined, // partialReadsEnabled
)
// Should contain default sections
expect(prompt).toContain("TOOL USE")
expect(prompt).toContain("CAPABILITIES")
expect(prompt).toContain("MODES")
expect(prompt).toContain("Test role definition")
})
// Should contain default sections
expect(prompt).toContain("TOOL USE")
expect(prompt).toContain("CAPABILITIES")
expect(prompt).toContain("MODES")
expect(prompt).toContain("Test role definition")
},
)
it("should use file-based custom system prompt when available", async () => {
// Mock the readFile to return content from a file