How to Improve Test Coverage to 80% with Generated Unit Tests and Stay Calm
summary
A generator creates React component scaffolding plus unit tests that fully cover all generated code; Jest snapshot tests and a sandbox exercise render branches. The workflow adds linters, pre-commit hooks and CI, while schema-driven mock generation and property testing produce varied inputs and proxies catch mutated constants. This approach yields about 80% test coverage overall, leaving roughly 20% (side effects, network handlers, event processors) for manual tests.
AI-written summary · about
chapters (8)
- 0:00Test coverage introduction
- 3:20Automating tests with linters
- 8:15Generating components and tests
- 11:26Isolated testing sandboxes
- 15:42Test data generation
- 18:55Jest setup and snapshots
- 21:26CI/CD test integration
- 24:57Getting started with tests
related talks
45mWrite fewer tests! Model-based testing in React
32mEstablishing testing patterns with software design principles
27mWrite Fewer Tests! From Automation to Autogeneration
38mMutants to the rescue: How effective are your unit tests?
48mModern Testing Patterns
01h 00mTest Driving React Applications
03mTest coverage
43mFrom 0% to Cleanly Refactored 100% tested code
