~/talk

Using MockStore in NgRx 8

Talkat AngularUP 2019 Β· on Wednesday, 2019-06-12Β· [angular, testing]
slides:none on file

NgRx adds a testing API that replaces dispatching real actions with direct state and selector control: provideMockStore (v7) lets tests call setState to supply a base state, while v8 adds overrideSelector so tests return values for specific selectors without building full state. Tests assert that a component dispatches a loadCart action on init and that a text observable emits "loading" or the cart count when selectors return true/false. A scannedActions observable captures dispatched actions for verification.

AI-written summary Β· about

  1. 0:00Introduction to NgRx testing
  2. 1:47Testing strategies
  3. 4:00Drawbacks of NgRx v6 testing
  4. 6:17Testing with MockStore
  5. 12:11Using Mock Selectors
  6. 16:12Verifying dispatched actions
  7. 18:31Testing store-dependent effects
  8. 22:33NgRx v8 updates and conclusion
~/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.