Рет қаралды 217
Jest has been the go-to for React component testing. It has some great pros like package mocking. But it also has several downsides including:
- fake browser rendering (jsdom)
- difficult debugging (node)
- act errors (ugh)
- no visuals (only dom output)
You may know Cypress for its e2e testing, but have you heard of Cypress Component testing?
It’s pretty amazing. Everything runs in a real browser. Which means debugging is a snap. You see everything render which makes test writing a breeze. And say goodbye to act errors, mock issues and random unknown data calls. Oh, and did I mention parallelization built in?
In this talk, I’ll cover the pros and cons of both jest and cypress including some live demos of writing, mocking, and debugging tests in both frameworks.