DEV Community


Front End Testing libraries recommendation for your next project

angelomiranda profile image angelo.miranda ・2 min read

Alt Text

I am fortunate to take the path of becoming a software engineer. The experience learned from working professionally allows me to see the evolution of testing libraries. It gets better as time goes by. I get to utilize a variety of libraries and it hasn't been easier to use and integrate with any projects.

It is quite daunting to research which one to use as choices are enormous. I do not personally think there is a right answer in which libraries are the best. Integration, method signatures, written documentation, and ease of use differs from one to the other. My suggestion is to research a little to narrow down libraries and then try it out personally or with your team weighing pros and cons. At this time, I would recommend Jest and Cypress.

One can use Jest will be used for snapshot and unit testing while Cypress for integration testing. Snapshot tests are important to prevent unintentional modification on application templates. For example, a template as written as <div><h1>This is a heading<h1></div> then a engineer accidentally update it to <div><h1>This is a heading.<h1></div>. Jest will be able to catch this error and prompt the user about the change and the engineer can either accept the change or revert the update on the template. Both Jest's unit test and Cypress integration tests can help prevent application from breaking. I would not get into much detail of each on the why and how as the topic is too broad to cover, perhaps in the next post. :D My main reason for choosing both of these libraries is that they are easy to integrate and use, excellent community, and have great documentation.

What about you? Which testing framework have you looked into, or have used in the past? Do you agree with my testing libraries of choice?

Additional Notes
This post will avoid textbook definitions that have been well-defined by others. I believe that these definitions can be searched so there is no need to include them here.

Discussion (0)

Editor guide