mockAgent() creates a runtime-neutral Agent mock with writable signals for testing @ngaf/chat components. Use it when you are testing chat UI behavior and do not need LangGraph-specific fields.
Import:
import { mockAgent } from '@ngaf/chat';import type { MockAgent } from '@ngaf/chat';
Signature
function mockAgent(options?: MockAgentOptions): MockAgent
Options
Option
Type
Default
Description
messages
Message[]
[]
Initial runtime-neutral messages
status
AgentStatus
'idle'
Initial agent status
isLoading
boolean
false
Whether the agent is currently running
error
unknown
null
Initial error value
toolCalls
ToolCall[]
[]
Initial tool-call list
state
Record<string, unknown>
{}
Initial agent state
withInterrupt
boolean
false
Include a writable interrupt signal
withSubagents
boolean
false
Include a writable subagents signal
history
AgentCheckpoint[]
undefined
Include history and return an AgentWithHistory-compatible mock
Use mockLangGraphAgent() from @ngaf/langgraph only when the test needs LangGraph-specific signals such as raw LangGraph messages, checkpoint state, branches, queued runs, or transport metadata.