Techdomain
  • Tutorials(current)
  • Images
  • About
  • Twitter
Learn unit testing in React using react testing library

Learn unit testing in React using react testing library

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.

React JS Testing
What are render phase and commit phase in react dom?

What are render phase and commit phase in react dom?

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.

React 16 tutorial
How to get started with Gatsby themes

How to get started with Gatsby themes

Learn about getting started with creating the Gatsby themes. You will also learn about consuming the Gatsby theme and publishing them as npm package.

Gatsby
How to test the snapshot of UI with changing ids like chart or primary keys

How to test the snapshot of UI with changing ids like chart or primary keys

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.

React JS Testing
Why use purecomponent when React DOM renders only on difference?

Why use purecomponent when React DOM renders only on difference?

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

React 16 tutorial
Why do we have to call super(props) in constructor react?

Why do we have to call super(props) in constructor react?

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.

React 16 tutorial
Difference between enzyme and react-testing-library

Difference between enzyme and react-testing-library

Difference between react-testing-library and enzyme on setup, concept, forceUpdate or shallow/deep rendering of the component

React JS Testing
How to test routes (react router dom) in react using jest and memory router – 2

How to test routes (react router dom) in react using jest and memory router – 2

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.

React JS Testing
How to test routes (react router dom) in react using jest – 1

How to test routes (react router dom) in react using jest – 1

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.

React JS Testing
How to unit test state of the component using jest and enzyme

How to unit test state of the component using jest and enzyme

Learn how to unit test the state of the component and spying on the instance method and accessing UI components inside the component.

React JS Testing
  • Home
  • 1
  • 2
  • 3
  • 4