This `afterEach()` isn't necessary -- you can just put the `if (needsReset)` block at the bottom of this function.