r/reactjs•
FlatProtrusion

Confused with react testing library, Jest and Vitest

Needs Help

I am looking to do unit testing with Vitest since I am using Vite. But it seems I need other dependencies like react testing library and Jest?
I've read that Jest is a test runner and Vitest is one as well? So do I use Vitest with Jest or Vitest with react testing library?
Watched a couple of tutorials but still having trouble with the configuration.

For e.g I am trying to test a page called Redirectedpage component, which gets state passed in by UseNavigate() from another page component, and retrieved in Redirectedpage .

Posted Jun 26, 2024, 3:02 AM UTC

216
Loading comments…