Skip to content

Ensure spy implementations do not persist into subsequent tests globally#850

Draft
123mpozzi wants to merge 3 commits into
developfrom
feature/jest-ensure-spy-implementations-do-not-leak-between-tests
Draft

Ensure spy implementations do not persist into subsequent tests globally#850
123mpozzi wants to merge 3 commits into
developfrom
feature/jest-ensure-spy-implementations-do-not-leak-between-tests

Conversation

@123mpozzi

@123mpozzi 123mpozzi commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

Description

In our global Jest config, we already have clearMocks: true, which clears call history but doesn't restore original implementations; restoreAllMocks fills that gap for jest.spyOn calls.

Checklist (for PR submitter and reviewers)

  • CHANGELOG entry - no need, dev experience change only

@123mpozzi 123mpozzi self-assigned this Apr 17, 2026
@123mpozzi 123mpozzi marked this pull request as ready for review April 17, 2026 00:35
@123mpozzi 123mpozzi requested a review from Copilot April 17, 2026 00:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@123mpozzi 123mpozzi marked this pull request as draft April 17, 2026 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants