In this tutorial, we are going to look into testing react.js applications using React Testing Library. We are going to go though dom-testing-library and a simple example to showcase react-testing-library.
Learn about the difference between the render phase and commit phase in react. Render phase is called multiple times while commit phase is called only once.
Learn about getting started with creating the Gatsby themes. You will also learn about consuming the Gatsby theme and publishing them as npm package.
Learn how to snapshot test the react component in 3 ways - 1. Mocking the dynamic function 2. Passing the dynamic value as prop 3. Using the property matches.
Purecomponent is similar to React.Component, the only difference is that React.PureComponent implements a method called shouldComponentUpdate with shallow prop and state comparison. React documentation recommends
super(props) is required to be called in constructor to access this.props. If it is not called in constructor, then this.props will be undefined in constructor.
Difference between react-testing-library and enzyme on setup, concept, forceUpdate or shallow/deep rendering of the component
Learn how to test the routes in react. In part 2 of the post, we will look into testing the routes using the MemoryRouter object.
Learn how to test the routes in React. In part 1 of the post, we will look into testing the routes using an object of pathname and component name.