DEV Community

Discussion on: Wow! Cypress can run unit tests! 🥳

Collapse
 
pegahsafaie profile image
Pegah Safaie

What about Mocha? It can run our tests in the browser as well

Collapse
 
dgreene1 profile image
Dan Greene • Edited

They’re really different tools entirely. I’d recommend you try Cypress out to see how it lends itself better to end-to-end or mocked API end-to-end tests as where mocha is a unit testing tool. As shown above Cypress can also do unit testing too but it’s a newer thing for Cypress.

I reach for both when the timing is right (although I rarely use Mocha anymore since if I need to write unit tests I use Jest and in most other places I rely on TypeScript to enforce things).

Cypress gives me sanity. :)