Skip to content

kevinYCKim33/react-testing-library-course

 
 

Repository files navigation

react-testing-library-course

Course material for testing React components using react-testing-library

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

Note: the setup for this project uses kcd-scripts. Don't worry about that. You can learn about how to configure jest properly in the "Configure Jest for Testing JavaScript Applications" module of TestingJavaScript.com

  1. Intro to Test React Components with Jest and React Testing Library
  2. Render a React Component for Testing
  • react-dom.js
  1. Use Jest DOM for Improved Assertions
  • jest-dom.js
  1. Use DOM Testing Library to Write More Maintainable React Tests
  • dom-testing-library.js
  1. Use React Testing Library to Render and Test React Components
  • react-testing-library.js
  1. Debug the DOM State During Tests using React Testing Library’s debug Function
  • react-testing-library.js
  1. Test React Component Event Handlers with fireEvent from React Testing Library
  • state.js
  1. Improve Test Confidence with the User Event Module
  • state.js
  1. Test Prop Updates with React Testing Library
  • prop-updates-01.js
  1. Assert That Something is NOT Rendered with React Testing Library
  • prop-updates-02.js
  1. Test Accessibility of Rendered React Components with jest-axe
  • a11y.js
  1. Mock HTTP Requests with jest.mock in React Component Tests
  • http-jest-mock.js
  1. Mock HTTP Requests with Dependency Injection in React Component Tests
  • dependency-injection.js
  1. Mock react-transition-group in React Component Tests with jest.mock
  • mock-components.js
  1. Test componentDidCatch Handler Error Boundaries with React Testing Library
  • error-boundary-01.js
  1. Hide console.error Logs when Testing Error Boundaries with jest.spyOn
  • error-boundary-02.js
  1. Ensure Error Boundaries Can Successfully Recover from Errors
  • error-boundary-03.js
  1. Use React Testing Library’s Wrapper Option to Simplify using rerender
  • error-boundary-04.js
  1. Test Drive the Development of a React Form with React Testing Library
  • tdd-01-markup.js
  1. Test Drive the Submission of a React Form with React Testing Library
  • tdd-02-state.js
  1. Test Drive the API Call of a React Form with React Testing Library
  • tdd-03-api.js
  1. Test Drive Mocking react-router’s Redirect Component on a Form Submission
  • tdd-04-router-redirect.js
  1. Test Drive Assertions with Dates in React
  • tdd-05-dates.js
  1. Use Generated Data in Tests with tests-data-bot to Improve Test Maintainability
  • tdd-06-generate-data.js
  1. Test Drive Error State with React Testing Library
  • tdd-07-error-state.js
  1. Write a Custom Render Function to Share Code between Tests and Simplify Tests
  • tdd-08-custom-render.js
  1. Test React Components that Use the react-router Router Provider with createMemoryHistory
  • react-router-01.js
  1. Initialize the history Object with a Bad Entry to Test the react-router no-match Route
  • react-router-02.js
  1. Create a Custom render Function to Simplify Tests of react-router Components
  • react-router-03.js
  1. Test a Redux Connected React Component
  • redux-01.js
  1. Test a Redux Connected React Component with Initialized State
  • redux-02.js
  1. Create a Custom Render Function to Simplify Tests of Redux Components
  • redux-03.js
  1. Test a Custom React Hook with React’s Act Utility and a Test Component
  • custom-hook-01.js
  1. Write a Setup Function to Reduce Duplication of Testing Custom React Hooks
  • custom-hook-02.js
  1. Test a Custom React Hook with renderHook from React Hooks Testing Library
  • custom-hook-03.js
  1. Test Updates to Your Custom React Hook with rerender from React Hooks Testing Library
  • custom-hook-04.js
  1. Test React Portals with within from React Testing Library
  • portals.js
  1. Test Unmounting a React Component with React Testing Library
  • unmounting.js
  1. Write React Application Integration Tests with React Testing Library
  • app-01.js
  1. Improve Reliability of Integration Tests using find* Queries from React Testing Library
  • app-02.js
  1. Improve Reliability of Integration Tests Using the User Event Module
  • app-03.js

About

Test React with react-testing-library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%