Loading lesson…
Level 1 · Apprentice0 XP
Test suspending code with virtual time, and fake dependencies cleanly.
Step 1 / 5
ProblemA retry function waits 10 seconds between attempts. Its test really waits, so the suite takes minutes, and developers stop running it.
← → step
Before this: Shared state, Mutex and channels
🛠️ Your turn
Reading is not the skill, doing is. Try for ten minutes before you open the hint. Getting stuck first is what makes the solution stick.
1.Test a ViewModel that loads data with a 2-second timeout and a retry, using runTest for virtual time, Turbine for its StateFlow, and a fake repository instead of mocks.