6. Tests
In chapter 4 we checked the counters by hand: type 42, click +1, see 43. After the next change in the store, you'd have to click through everything again. Tests can do that clicking for us.
We use Vitest. It reuses the Vite setup the app already has. This is also where keeping the state in MobX classes pays off: a store is just a class, so a test can create one, call its actions and check the values without rendering any React.
The counter store from chapter 4 is already here. Run tests runs your tests right in the page.