tRPCttRPC
Powered by
Daniel SD
tRPC•3y ago
Daniel S

Examples of Vitest with React Testing Library

Does anyone have examples of how to mock data from tRPC procedure calls? I have client components that are fetching data using tRPC , and I want to run integration tests.

I have been attempting to use
vi.mock()
vi.mock()
to mock this data but I haven't gotten it to work correctly. Thanks in advance!

https://vitest.dev/guide/mocking.html
Vitest
A blazing fast unit test framework powered by Vite
Vitest
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Testing with React Testing Library
ZephZZeph / ❓-help
4y ago
Test example for react-testing-library
lukasLlukas / ❓-help
4y ago
Vitest error test
MugetsuMMugetsu / ❓-help
3y ago