~/talk

JS Unit Testing Good Practices & Horrible Mistakes

Talkat GOTO Aarhus 2013 · 2013-09-30..10-02· [testing, javascript]
slides:none on file

Argues that unit tests must be trustworthy, maintainable, readable and gives concrete rules: treat a unit as a unit of work, not a single method; keep mock objects to about 5% mocks of tests (only for fire‑and‑forget external calls) and prefer stubs otherwise; separate fast in‑memory unit suites from slower integration tests into a safe green zone project; avoid logic or shared mutable fixtures in tests; show real failures in jQuery/OpenLayers/QUnit examples and recommend one mock per test and clearer describe/it nesting.

AI-written summary · about

  1. 0:00Introduction
  2. 1:30Horrible Mistakes
  3. 5:30Test Reviews
  4. 9:40Mock Objects
  5. 13:10Differentiation
  6. 14:40State Based
  7. 16:33Integration Tests
  8. 18:23OpenLayer
  9. 20:01jQuery
  10. 20:24jQuery bugs
  11. 21:25Trust problem
  12. 25:07Forced assertion counts
  13. 27:59Readability
  14. 30:42Comments
  15. 31:44Naming
  16. 33:46The Test of Doom
  17. 35:34Backbone
  18. 36:33Jasmine
  19. 38:24Knockout
  20. 39:34Setup Methods
  21. 41:12Test Multiple Methods
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.