Old solutions to new testing problems
summary
xUnit Test Patterns provides five concrete warning signs and fixes applied to JavaScript: a flexible test with loops becomes split simple tests; a mystery guest caused by shared fixtures becomes inline/delegated/implicit setup; noisy fixtures get a minimal or parameterised creation approach (use test-data-bot or custom creators); interacting tests are solved with fresh fixtures or deep clones; duplicated production logic in assertions is replaced by hard‑coded, easy-to-check examples. Tools mentioned include Jest, Cypress and Percy.
AI-written summary · about
chapters (28)
- 0:00Old Solutions
- 0:29JavaScript test tooling has improved a lot.
- 0:49The problem now: Test Maintainability
- 1:25How can we learn how to write more maintainable tests?
- 3:03Five Patterns
- 3:27Takeaways
- 4:211 "Code Smells"
- 7:07A Flexible Test
- 7:26Solution: Simple Tests
- 10:17A Mystery Guest
- 11:52In-Line Setup Each Test Method creates its own Fresh Future by building eactly
- 12:16Delegated Setup
- 13:49Implicit Setup We build the test future common to several tests in the setup
- 16:08A Irrelevant Information
- 16:46General Fixture
- 16:57Minimal Fixture
- 17:18What if that data is still needed for the code to run?
- 17:58Parameterized Creation Method
- 20:13Test Data Creation Libraries
- 23:06A Interacting Tests
- 23:50A Shared Fixture
- 24:18Solution: Fresh Fixture
- 27:00A Production Logic in Test
- 27:51Solution: Hard-Coded Test Data !
- 28:41Review: Test Patterns
- 30:02Let's talk about test patterns!
- 30:24The deeper takeaway...
- 31:04Let's connect people with our rich testing history
related talks
30mIt's a (testing) trap! - Common end-to-end pitfalls and how to solve them
21mTests That Help you Find Defects Faster
42mSurviving the JS Testing Tools Jungle
23mIt's a Testing Trap
39mTesting, Testing, 1, 2, NaN
19mIt's a (Testing) Trap! - Common Testing Pitfalls and How to Solve Them
45mWriting Tests That Don't Suck: TDD in JavaScript
16mA unit test walks into a bar
