Writing better tests for your JavaScript app
summary
Shows concrete patterns and tools: uses Jest snapshot testing and Enzyme to keep most tests in-process, mock external HTTP with fetch-mock, and control timers to avoid waits. Raises functions into pure modules, uses a test seam or in-memory SQLite for reproducible subcutaneous API tests, and runs higher-level checks with supertest. Recommends UI tests only for deployment smoke checks and encapsulating interactions with the page object pattern. Demonstrates defensive checks (fail on unmatched API calls) and reports that snapshots drastically speed maintenance.
AI-written summary · about
chapters (11)
- 0:00Introduction to testing
- 1:26Defining testing goals
- 3:27Testing strategies
- 8:06Unit testing fundamentals
- 11:53Snapshot testing techniques
- 24:47High-level testing
- 28:49SPA and node API testing
- 37:40Subcutaneous testing
- 46:44Integration testing
- 50:00Page object pattern
- 56:33Conclusion and recap
related talks
41mUI and Unit Testing with Airbnb's Enzyme
39mTesting, Testing, 1, 2, NaN
21mTesting Javascript: Building JavaScript applications you won't hate
26mTip Top Testing in JavaScript
29mTesting Is All About Principles
37mFront-end Testing for Skeptics
45mWriting Tests That Don't Suck: TDD in JavaScript
19mModern Testing Strategies for Reactive Applications
