~/talk

Angular components - unit testing

Talkat NG Poland 2018 · on Friday, 2018-11-16· [testing, angular]
slides:none on file

Example Angular app (spacefleet + spaceship) gets unit-tested with Angular CLI default stack: TestBed.configureTestingModule and fixture APIs, running tests with ng test under Jasmine/Karma. Mocks replace child components and a mocked spaceship service returns two ships (Viper, Raptor). Tests assert component instantiation, fleet name rendering, two child spaceship elements, and that clicking the create button calls spaceshipService.createShip. All tests execute in-browser with manual detectChanges and pass.

AI-written summary · about

  1. 0:00Introduction
  2. 1:10Why components are special
  3. 2:15Testing tools
  4. 3:05Dependencies
  5. 4:40Mocking
  6. 5:55Presentation
~/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.