How to Confidently Write Unit Tests using React Testing Library

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • testing-library-demo

    React Testing Library Demo

  • Add the content from this link in the Register.jsx file and inside register.css file add contents from this link.

  • vite

    Next generation frontend tooling. It's fast!

  • We will be using Vite which is the most popular and a faster alternative to create-react-app.

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • testing-library-docs

    docs site for @testing-library/*

  • The React Testing Library has a set of packages that helps you test UI components in a user-centric way which means just like how the user interacts with the various elements displayed on the page.

  • react-hook-form

    📋 React Hooks for form state management and validation (Web + React Native)

  • Also, instead of managing the state and onChange handler yourself, you can use a very popular react-hook-form library.

  • react-bootstrap

    Bootstrap components built with React

  • We will use react-bootstrap to create the UI elements so we don't have to write all CSS from scratch.

  • jest

    Delightful JavaScript Testing.

  • We cannot only use the testing library alone, but we also need to install Jest which exposes extensively used global expect function and other things which help to make assertions in our test cases.

  • Enzyme

    JavaScript Testing utilities for React

  • So If you have experience with enzyme testing, where you might be checking the value of state once you click any button or you might be checking the prop value If something changes.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts