-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Describe the feature you'd like to request
tRPC's core repository uses powerful internal helpers to spin up an in-process server and typed client for integration tests, but application developers have no stable, public way to do this. Introduce an official testing harness so users can write router-level integration tests without depending on internal test utilities.
Describe the solution you'd like to see
Implement a dedicated testing package that exposes a single high-level helper to create a fully wired tRPC server and client pair for a given router. Ensure the helper infers router types, accepts optional context and link configuration, and actually routes calls through HTTP or WebSocket adapters. Preserve existing public APIs and behavior when the helper is not used. Errors thrown by procedures must surface as standard tRPC client errors on the caller side.
Describe alternate solutions
Expose a new public module '@trpc/testing' exporting a function named 'testServerAndClient' used only in tests.
Additional information
No response
π¨βπ§βπ¦ Contributing
- πββοΈ Yes, I'd be down to file a PR implementing this feature!