DEV Community

Discussion on: Testing a React Application: The Modern Approach

Collapse
 
devdufutur profile image
Rudy Nappée

Not sure navigator object or Scroll position are really important in such tests but I'm interested to know if someone has needs that cannot be covered by testing lib

Thread Thread
 
diballesteros profile image
Diego (Relatable Code)

Outside of browser APIs, I would say it mostly depends on your overall goals. As said in the post Cypress offers more visual oriented test development at the cost of speed based on the real browser engine so its closest it can be possibly be to the user-environment. This is the biggest benefit. For me the confidence in knowing its the closest to the user-environment.

Vitest is crazy fast and headless and covers its own use cases. In the end it really depends on what use cases you need for your team/app.

I prefer to use both. Smoke testing and covering big features with cypress to take advantage of the browser-based running. I can split the tests to test in firefox, chrome and safari. while with vitest I can get more granular.