How to Unit Test a Flowbite Svelte Modal with Vitest in real time

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. This article is all about writing unit tests for the modal using real timers. Write some Tests Start with the describe…