test: fix ralph-loop tests by adding promptAsync to mock

The ralph-loop hook calls promptAsync in the implementation, but the
test mock only defined prompt(). Added promptAsync with identical
behavior to make tests pass.

- All 38 ralph-loop tests now pass
- Total test suite: 2361 pass, 3 fail (unrelated to this change)
This commit is contained in:
YeonGyu-Kim
2026-02-08 02:41:29 +09:00
parent 3d4ed912d7
commit b2661be833
2 changed files with 21 additions and 14 deletions
+7
View File
@@ -24,6 +24,13 @@ describe("ralph-loop", () => {
})
return {}
},
promptAsync: async (opts: { path: { id: string }; body: { parts: Array<{ type: string; text: string }> } }) => {
promptCalls.push({
sessionID: opts.path.id,
text: opts.body.parts[0].text,
})
return {}
},
messages: async (opts: { path: { id: string } }) => {
messagesCalls.push({ sessionID: opts.path.id })
return { data: mockSessionMessages }