More Premium Hugo Themes Premium React Themes

React Testing Library Course

Test React Components with Jest and React Testing Library on TestingJavaScript.com

React Testing Library Course

Test React Components with Jest and React Testing Library on TestingJavaScript.com

Author Avatar Theme by kentcdodds
Github Stars Github Stars: 1089
Last Commit Last Commit: Oct 18, 2022 -
First Commit Created: Dec 18, 2023 -
default image

Overview:

This product analysis focuses on a course material for testing React components using react-testing-library. The course material includes various topics such as rendering React components for testing, using jest-dom for improved assertions, writing more maintainable React tests with dom-testing-library, testing localized content, testing React component state changes, testing prop updates, testing accessibility of rendered React components, mocking HTTP requests with dependency injection or jest.mock, mocking react-transition-group, testing componentDidCatch handler error boundaries, test driving the development of a React form, testing the functionality of a React form, testing react-router provider history object, testing a redux connected React component, testing a custom hook, testing React portals, and testing unmounting a React component.

Features:

  • render: Render a React component for testing
  • jest-dom: Use jest-dom for improved assertions
  • dom-testing-library: Use dom-testing-library to write more maintainable React tests
  • react-testing-library: Use react-testing-library to render and test React components
  • localized: Testing localized content with react-testing-library
  • state: Test React component state changes with react-testing-library
  • prop-updates: Test prop updates with react-testing-library
  • a11y: Test accessibility of rendered React components with jest-axe
  • dependency-injection: Mock HTTP requests with dependency injection in React component tests
  • http-jest-mock: Mock HTTP requests with jest.mock in React component tests
  • mock-component: Mock react-transition-group in React component tests with jest.mock
  • error-boundaries: Test componentDidCatch handler error boundaries with react-testing-library
  • tdd-markup: Test drive the development of a React form with react-testing-library
  • tdd-functionality: TDD the functionality of a React form with react-testing-library
  • react-router: Test react-router Provider history object in React component tests with createMemoryHistory
  • redux: Test a redux connected React component
  • custom-hook: Test a custom hook
  • portals: Test React portals
  • unmounting: Test unmounting a React component with react-testing-library
  • app: Test the full application

Installation:

This course material assumes the setup of kcd-scripts. To configure jest properly, refer to the “Configure Jest for Testing JavaScript Applications” module of TestingJavaScript.com.

Summary:

This product analysis explores a comprehensive course material for testing React components using react-testing-library. It covers a wide range of topics including rendering components, improved assertions, writing maintainable tests, testing localized content, handling component state changes, testing prop updates, accessibility testing, mocking HTTP requests, testing error boundaries, test driving form development, testing react-router, testing Redux-connected components, testing custom hooks, testing portals, testing unmounting, and testing the full application. The course material provides a thorough guide on how to effectively test React components using react-testing-library.