Dan Tech Academy
After this lesson you will
  • Write an emission ledger: collector first, trigger, drain virtual time, and only then assert
  • Choose StateFlow for renderable state and SharedFlow for one-time UI events
  • Control Dispatchers.Main and QzDispatchers in tests so ViewModel tests can run in commonTest
Duration6 min
DifficultyIntermediate

Test Flows And ViewModels

Test state emissions without tapping the UI by hand.

What this lesson covers
  1. 01Lesson Goal
  2. 02Part 1: The Emission Ledger: StateFlow Or SharedFlow?
  3. 03Part 2: Control The Clock In ViewModel Unit Tests
  4. 04Part 3: A ViewModel Test That Runs On iOS
  5. 05Part 4: Test A ViewModel's Sequence Or Its Settled State
  6. 06Code Reading Path
  7. 07Signs To Avoid
  8. 08References
  9. 09Key Points

Topics: mobile-action-pro, release-readiness

9 sections left in this lessonUnlock all of Mobile Action ProLesson Goal, Part 1: The Emission Ledger: StateFlow Or SharedFlow?, … — plus 114 lessons in this course, source code and checklists.
Unlock Mobile Action ProOne-time payment — lifetime access — 7-day money-back. Already purchased? Sign in
Sign in