~/talk

Unit Tests for Angular 2 Applications

Talkat ng-europe 2016 · 2016-10-25..10-26· [angular, testing]
slides:none on file

Angular 2 unit testing focuses on concrete tools and recipes: use the testing module and TestBed.compileComponents to precompile templates, choose between real async (zones and fixture.whenStable) or fakeAsync/tick for controlled timing, get fixtures and call detectChanges to update the DOM, query with DebugElement or nativeElement, replace HTTP with MockBackend to control responses, and use RouterTestingModule or shallow stub components to keep tests isolated and fast.

AI-written summary · about

  1. 0:00Introduction to testing
  2. 1:10Changes in Angular 2 testing
  3. 3:21Deciding testing approach
  4. 7:56Locating elements in tests
  5. 9:21Testing simple components
  6. 13:59Mocking services in tests
  7. 18:36Handling async operations
  8. 21:04Testing services with HTTP
  9. 22:29Testing routing setup
  10. 24:42Testing nested components
~/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.