~/talk

Angular Unit Testing from the Trenches

Talkat NDC Minnesota 2018 · 2018-05-07..05-10· [testing, angular]
links:none on file
slides:none on file

Practical, example-driven guide to unit testing Angular apps using the CLI with Karma and Jasmine, showing real code: component creation and DOM binding, TestBed + async + detectChanges for lifecycle and change detection, stubbing services versus Jasmine spies for Observable-driven ngOnInit, handling reactive-form gotchas (markAsDirty, debounce + tick), and HTTP tests with HTTPTestingController.flush to avoid hitting the backend. Routing checks use RouterTestingModule and a spy Location. Emphasis on fast, isolated, maintainable tests.

AI-written summary · about

  1. 0:00Intro
  2. 8:43Best Practices
  3. 13:35Test Setup
  4. 14:05Testbed
  5. 15:34Simple Component
  6. 16:53Creating a Fixture
  7. 19:00Testing the DOM
  8. 20:23Recap
  9. 21:20Service Dependency
  10. 21:51stub
  11. 23:37spies
  12. 26:18tick
  13. 27:27stubs
  14. 28:21reactive forms
  15. 32:43dirty flag
  16. 35:21HTTP services
  17. 39:42HTTP testing
  18. 42:11Router testing
  19. 49:16Jasmine goodies
  20. 51:33Additional message
  21. 52:29Dont run this
  22. 52:55Release faster
  23. 53:17Look through the codebase
  24. 53:35Keep them fast
  25. 53:47Keep them simple
  26. 54:24Resources
~/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.