Declarative and Scalable Testing With React Testing Library

By Medium - 2020-12-31

Description

“All code is guilty, until proven innocent.” —  Anonymous

Summary

  • Let’s be honest, writing tests for your React components is probably not your favorite thing to do.
  • Another big reason I prefer using React Testing Library is because of the libraries philosophy which essentially states that your tests should resemble the way your users will interact with your app.
  • When one of your users is using your app they are not aware of the fact that they are interacting with state and props.
  • So, rather than testing whether or not the correct props or state were changed in your component, React Testing Library is designed in such a way that you have to test what your users are seeing and doing.

 

Topics

  1. UX (0.4)
  2. Frontend (0.24)
  3. Management (0.13)

Similar Articles

React Component Tests for Humans

By CSS-Tricks - 2021-02-23

React component tests should be interesting, straightforward, and easy for a human to build and maintain. Yet, the current state of the testing library

React Testing Checklist

By Medium - 2020-12-07

Use it to make sure that your React components are tested thoroughly. All examples use the Jest and React Testing Library.

Design Thinking Phase 5 - How to Test Effectively

By workshopper - 2020-11-20

Testing provides the guidance and validation that design teams need in order to create great products. User testing can be inspiring and can help to work out any flaws that a product has before being ...

sudheerj/reactjs-interview-questions

By GitHub - 2021-01-12

List of top 500 ReactJS Interview Questions & Answers....Coding exercise questions are coming soon!! - sudheerj/reactjs-interview-questions