Hi I'm new to testing, since Nextjs contains both front-end and back end, how can we test both? If I set the environment to jsdom some of my tests in api/ doesn't work as they require some node/serverside lib/functionality but when I change the environment to node the front end test fails.
Hi, you will need a mechanism for intercepting your trpc requests and stubbing your responses. I use mock service worker for REST APIs but not quite sure if it supports trpc.
Hi, would you happen to know how to mock next/dynamic and test components which dynamically import other components ? Great video btw :D
Hi I'm new to testing, since Nextjs contains both front-end and back end, how can we test both?
If I set the environment to jsdom some of my tests in api/ doesn't work as they require some node/serverside lib/functionality
but when I change the environment to node the front end test fails.
i have trpc and wen i run the test I'm getting :
> Render Documents Module
TRPCClientError: `cookies` was called outside a request scope.
Hi, you will need a mechanism for intercepting your trpc requests and stubbing your responses. I use mock service worker for REST APIs but not quite sure if it supports trpc.
@@webboss hmmm 🤔
thanks man I ll check
I think bc I have auth not sure but lemme keep checking Google
Great video!
Thanks!