Vitest rendering an empty div when RouterProvider is used
I have found that when unit testing with Vitest, if I pass a RouterProvider to the render function, the result is always a empty div, i.e:
I've tried to follow a couple of examples of wrappers that have been posted here and on GitHub, but they all have the same result.
I've created a minimal reproduction here:
https://stackblitz.com/edit/tanstack-router-1wnwna?file=src%2Fmain.test.tsx&view=editor
Just run
Any advice is greatly appreciated.
I've tried to follow a couple of examples of wrappers that have been posted here and on GitHub, but they all have the same result.
I've created a minimal reproduction here:
https://stackblitz.com/edit/tanstack-router-1wnwna?file=src%2Fmain.test.tsx&view=editor
Just run
npm run test to see what I mean.Any advice is greatly appreciated.
StackBlitzDani Bednarski
Run official live example code for Router Basic, created by Tanstack on StackBlitz