ysads / budget-front

💰 💶 💵 Front-end for a budget manager heavily inspired by YNAB principles
budget-front-ysads.vercel.app
0 stars 0 forks source link

Watchers need setTimeout to be tested #334

Open ysads opened 3 years ago

ysads commented 3 years ago

For some reason, neither flushPromises nor nextTick worked when testing watchers, making setTimeout the only possible way to test side-effects on reactive properties. There should be a better way to do that without timeout functions. Maybe Vue libraries can give us a hint as to how to test that.

ysads commented 3 years ago

Using 0 as the delay of setTimeout seems to work just like any other positive value, yet no setTimeout still doesn't work.