Frontend Testing
Tests that mean something
A suite that has been green all week is a claim about four decisions somebody made: which level to test at, how to find things on the page, where to put the double, and what to do when it fails one run in twenty. This is the practice behind all four.
- Modules
- 4
- Drills
- 10
- Build steps
- 4
- Time
- ~4h
Walk out able to
Put a guard at the level a defect actually lives at, find a control the way a user does, and name a flaky test's cause from its symptom rather than re-running it.
What you practise
Pick the level
Where a defect lives, and what each failure is worth.
Query the accessible tree
Roles, names, and what each variant hands back.
Cut the seam
Where a double belongs, and the hole it leaves.
Diagnose a flake
Time, order, shared state, races, drift.
What you get
Skills that stick
Every project mixes short lessons, focused drills and real build steps, so you finish with working code and the judgement behind it.
You will practise
- Which level a defect should be caught at
- Choosing a query, and predicting its return
- Where a double goes, and what it hides
- Naming a flake from its symptom
Afterwards you can
- Pick the level a defect actually lives at
- Find a control the way a user finds it
- Say what a double stopped proving
- Diagnose a flake instead of re-running it
Modules
Step by step
Each module builds on the last. Read a short lesson, drill it until it's second nature, then put it to work.
- 1
Put the test where the bug is
~54 minName the lowest level that would have caught a defect, and what its failure would say.
- LessonWhy a green suite is a claim5 min
- LessonWhat each level of test can see7 min
- LessonWhy a suite's shape goes wrong6 min
- DrillName the lowest level that catches it10 min
- DrillRead what a test actually touches12 min
- Build stepRun a test and watch it fail8 min
- Build stepRead the failure back to the bug6 min
- 2
Find it the way a person would
~59 minQuery a rendered component through the accessible tree, and predict what comes back.
- LessonWhat a query hands back6 min
- LessonRole queries read the tree6 min
- LessonThe name option is not the text6 min
- DrillChoose the query for what is there10 min
- DrillPredict what the query hands back12 min
- DrillWork out what name has to match11 min
- DrillSpot the line that lies8 min
- 3
Cut the seam and count the cost
~54 minPut a double on the right boundary, and name what the test stopped proving.
- LessonPut the double on the right edge7 min
- LessonWhat a double stops proving6 min
- LessonAssert on the result, not the call5 min
- DrillChoose where the seam goes10 min
- DrillFind what the double stopped proving13 min
- Build stepStub the data and watch it pass6 min
- Build stepWatch a contract move under a stub7 min
- 4
Why tests go flaky
~1hDiagnose an intermittent failure from its symptom, and repair it instead of retrying.
- LessonFive ways a green suite lies7 min
- LessonThe flake the taxonomies miss5 min
- LessonA retry is a report, not a repair6 min
- DrillName a flake from its symptom11 min
- DrillRepair a flake instead of retrying13 min
- LessonWrite the flake report20 min
More in Web & frontend
Keep going
Modern CSS
Six features that changed what a stylesheet is.
Intermediate~4h6 modules
CSS: Layout
Predict the box before the browser draws it.
Intermediate~3h6 modules
CSS: Cascade & Specificity
Specificity is the fifth question, not the first.
Intermediate~4h5 modules
HTML & Semantics
Two documents that look identical. Only one of them says anything.
Foundational~4h6 modules
Ready when you are.
Work through it at your own pace and pick up right where you left off.