Skip to content

testSession

testSession(agent, inputs): Promise<TestSessionResult>

Multi-turn session test helper. Returns per-turn results and final session state.

Agent

The Agent instance to test

string[]

Array of user messages (one per turn)

Promise<TestSessionResult>

TestSessionResult with per-turn results and session data

const result = await testSession(agent, ["Hello", "Follow up", "Goodbye"])
expect(result.turns).toHaveLength(3)
expect(result.session.history).toHaveLength(6)