Testing LangChain Agents with Agentest: Mocks, Trajectories, and LLM-as-Judge
typescript
dev.to
In my last post, I introduced Agentest, a Vitest-style testing framework for AI agents. Let's put it to work on something concrete: a LangChain tool-calling agent. A full walkthrough of testing a LangChain tool-calling agent using Agentest, with mocked tools, trajectory assertions, and LLM-as-judge evaluation. No HTTP server needed. The complete demo is on GitHub: langchain-tool-agent. The Agent The agent is simple: a GPT model with four tools bound via LangChain's bindTools():