HalfStack Thames 2022: David Whitney
summary
Covers TDD in JavaScript with concrete setup and habits: npm init plus Jest and Babel preset to use ES modules, a VS Code workflow with Wallaby.js continuous test runner, and naming and refactor patterns like the AAA pattern and test data builders. Shows refactors that remove noisy fixtures, magic numbers and duplicated setup, mocks only external systems, and argues to test the what not the how so tests survive rewrites and give fast, local feedback.
AI-written summary · about
chapters (21)
- 0:00Introduction to testing journey
- 1:09Why unit testing matters
- 3:13Automated testing fundamentals
- 5:41Jest testing framework basics
- 8:06Types of software tests
- 10:30Setting up Jest in a project
- 13:36Writing basic Jest tests
- 15:23Test-driven development explained
- 19:20Continuous test runners
- 20:46Intentionality in test code
- 23:13AAA pattern for tests
- 26:00Refactoring messy test code
- 31:51Modern JavaScript in tests
- 32:55Test data builder pattern
- 33:37Mocking external systems
- 35:43Single concept assertions
- 37:29Testing capabilities over data
- 39:34The Diamond Cutter example
- 42:03Emerging developer tests style
- 44:55High-to-low TDD workflow
- 47:03Summary and Q&A
