~/talk

Testing with MockStore in NgRx 9

Talkat angularday 2020 · on Friday, 2020-12-04· [angular, testing]
slides:none on file

Shows concrete migration from importing StoreModule to using provideMockStore (NgRx v7) and mocking selectors with overrideSelector (v8) so tests update state via mockStore.setState and force emissions with mockStore.refreshState plus fixture.detectChanges. Demonstrates inspecting dispatched actions through the scannedActions observable. Examples use real code paths, note gotchas (mock selector updates don’t auto-emit), and present a standalone npm package for older NgRx versions so the techniques are practical and working.

AI-written summary · about

  1. 0:00Intro
  2. 0:43Welcome
  3. 2:50Why I love MockStore
  4. 4:00Overview
  5. 4:58Data Flow
  6. 6:37Unit Tests Example
  7. 11:22Implementing with MockStore
  8. 15:36Mock Selectors Example
  9. 18:21Mock Selectors Notes
  10. 19:28Validate Dispatched Actions
  11. 20:05Recap
  12. 21:13Closing remarks
  13. 21:44Test libraries
  14. 22:24Schematics
  15. 22:58Compatibility
  16. 23:29Start Small
  17. 23:51References Documentation
  18. 24:37Conclusion
  19. 26:45Asynchronicity
  20. 28:25RxJS Test Scheduler
  21. 29:27MockStore vs override selectors
  22. 31:19Favorite place to scuba dive
  23. 33:14NgRx testing libraries
  24. 35:15Outro
~/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.