alimcg1
TTCTheo's Typesafe Cult
•Created by alimcg1 on 1/27/2024 in #questions
Jest test for tRPC route
Hi guys,
I have been using Jest to test tRPC routes in a project like this:
With
"@trpc/server": "^10.9.0"
- everything works as expected.
However in a new project using the t-3 App router from npm create t3-app@latest
which has "@trpc/server": "^10.43.6",
:
'createCaller' is deprecated.ts(6385)
The types file for router.d.ts
say to use t.createCallerFactory(router)
instead and links to the docs: https://trpc.io/docs/server/server-side-calls
But I am struggling to make this work within the t-3 set up.
Has anyone else had this problem? Or any suggestions on how to fix it/ work around it?
Thanks1 replies