Test Driving React Applications
summary
Shows step‑by‑step TDD for React using Create React App, Jest and React Testing Library: starts with a canary test to verify environment, uses jest.mock to stub child components, demonstrates render + screen.get / query / find (get/query/find) and fireEvent to simulate typing and clicking, builds a small Greet component with useState, drives code until tests pass, and explains measuring coverage (aiming for high coverage, rule of three) and mocking async services. The demo compiles and tests green.
AI-written summary · about
chapters (7)
- 0:00Introduction to TDD
- 7:24Benefits of test driven development
- 14:47Setting up the environment
- 27:34Writing the first test
- 33:14Understanding code coverage
- 44:34Developing test writing skills
- 48:27Testing user interactions
related talks
10mTesting React Applications
53mTesting React Applications
30mTesting React Applications
33mTDCD: Test Driven Component Development
45mWrite fewer tests! Model-based testing in React
01h 03mProductive React/TypeScript/TDD: Love Story from Hell
06mJest & Enzyme-testing your React application
24mUsing React Testing Library to Write Stronger Tests
