Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: Official tRPC Testing Harness PackageΒ #7030

@Michealjunior

Description

@Michealjunior

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions