A test that passes proves little until you know which bugs it would catch. In these tasks the code under test comes in several versions: one correct, and others with a single realistic bug each. Your test has to pass the correct version and fail every broken one, which is how mutation testing measures a suite.
You will build a table of cases with the edges that matter, record calls with a spy instead of trusting a side effect, control time with a fake clock passed in as a function, and check that code throws the right error type, not just any error.
The same ideas carry straight over to Vitest or Jest: describe blocks and expect calls are wrappers around exactly these checks.
A spy turns a side effect into an array you can check.