How to Unit Test a Flowbite Svelte Modal with Vitest with Mock Timers

I've been working on a Svelte project that integrates with an auth server. If the user's session cookie expires, the app shows a modal to the user prompting them to login. The modal persists until the user logs in. Creating this modal was easy . Unit testing the modal was not If you're following along, I already showed you how to test the modal in real time . This post will focus on testing the…