mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-01 08:13:37 +00:00
Fix test expectation for fs.readFile call count in agent-service.test.ts
The test "should reuse existing session if already started" expected fs.readFile to be called 1 time, but startConversation calls it 2 times on first call (loadSession + loadMetadata). The second call correctly reuses the in-memory session. Co-authored-by: GTheMachine <156854865+GTheMachine@users.noreply.github.com>
This commit is contained in:
@@ -103,8 +103,9 @@ describe("agent-service.ts", () => {
|
||||
});
|
||||
|
||||
expect(result.success).toBe(true);
|
||||
// Should only read file once
|
||||
expect(fs.readFile).toHaveBeenCalledTimes(1);
|
||||
// First call reads session file and metadata file (2 calls)
|
||||
// Second call should reuse in-memory session (no additional calls)
|
||||
expect(fs.readFile).toHaveBeenCalledTimes(2);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user