Mock chat model
LangChain providesGenericFakeChatModel for mocking text responses. It accepts an iterator of responses (AIMessage objects or strings) and returns one per invocation. It supports both regular and streaming usage.
InMemorySaver checkpointer
To enable persistence during testing, you can use theInMemorySaver checkpointer. This allows you to simulate multiple turns to test state-dependent behavior:
Next steps
Learn how to test your agent with real model provider APIs in Integration testing.Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

