Skip to content

Commit 822ab8f

Browse files
author
liuxuezhuo
committed
fix(test): normalize path separators in sidecar readFile mock
On Windows hosts the requested sidecar path uses backslashes, so the mock's forward-slash branch check missed it and returned the main session transcript, breaking the subagent hydration assertion.
1 parent 9737de8 commit 822ab8f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

tests/unit/qoder/history/qoder-history-store.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2424,7 +2424,8 @@ describe('sdkSession', () => {
24242424
it('loads subagent tool calls from sidecar JSONL', async () => {
24252425
mockExistsSync.mockReturnValue(true);
24262426
mockFsPromises.readFile.mockImplementation(async (filePath: any) => {
2427-
const p = String(filePath);
2427+
// Normalize separators so the branch checks work on Windows hosts.
2428+
const p = String(filePath).replace(/\\/g, '/');
24282429
if (p.includes('subagents/agent-ae5eb9a.jsonl')) {
24292430
return [
24302431
'{"type":"assistant","timestamp":"2024-01-15T10:02:00Z","message":{"content":[{"type":"tool_use","id":"sub-tool-1","name":"Grep","input":{"pattern":"TODO"}}]}}',

0 commit comments

Comments
 (0)