Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@sundaray
Copy link

@sundaray sundaray commented Dec 26, 2025

Moved the patching and restoration of window.location from inside the individual tests to the beforeEach and afterEach hooks in the describe block.

Previously, if a test assertion failed before the inline restoration code ran, window.location would remain mocked, potentially polluting subsequent tests. With this change, afterEach guarantees restoration regardless of test outcome.

@sundaray sundaray requested a review from a team as a code owner December 26, 2025 19:29
@sundaray sundaray requested a review from ericroberts December 26, 2025 19:29
@sundaray sundaray changed the title fix(tests): move window.location mocking to beforeEach/afterEach fix(tests): move window.location patching and restoration to beforeEach/afterEach Dec 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant