testing library

Expectation helpers for testing MCP servers with package:test.

This entrypoint is separate from package:mcp_probe/mcp_probe.dart so that only code which actually asserts inside tests pulls in the package:test surface; the harness and the conformance checks do not need it.

Functions

expectResourceExists(McpServerHarness harness, String uri) Future<void>
Fails the current test if the server behind harness does not list a resource with the given uri.
expectToolCallFails(McpServerHarness harness, String name, {Map<String, Object?>? arguments}) Future<CallToolResult>
Calls the tool name with arguments and fails the current test unless the call reports an in-band error (isError: true).
expectToolCallSucceeds(McpServerHarness harness, String name, {Map<String, Object?>? arguments}) Future<CallToolResult>
Calls the tool name with arguments and fails the current test if the call reports an in-band error.
expectToolExists(McpServerHarness harness, String name) Future<void>
Fails the current test if the server behind harness does not list a tool named name.