DEV Community

Discussion on: How to write tests for React in 2020 - part 1

Collapse
djamaile profile image
Djamaile

Why use these types of test instead of e2e tests? Currently I am only using jest to test api methods and util functions. For the ui i am just using cypress.

Collapse
joserfelix profile image
Jose Felix

These types of tests are less expensive than a full-blown end-to-end. You should check this article by Kent C. Dodds which goes more into depth.

Collapse
kelvin9877 profile image
Kelvin Liang Author • Edited on

I think you probably right in most of the cases, but this article is intended to introduce testing for people just learning React or Front End development, who just want to get started with some simple test cases, and once they grasp the ideas, they can evolve whatever framework or tools they see fit in their situations. Beside, @Testing-library now is not just for React, it supports many other frameworks now in 2020, such as VUE, Angular, React Native, and even cypress, so I think it is a good starting point anyway.
testing-library.com/docs/intro