New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: remove duplicates from activeMocks()
and pendingMocks()
#2356
fix: remove duplicates from activeMocks()
and pendingMocks()
#2356
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks!
I was unable to merge the master to this PR to resolve the conflict, so I will wait for the contributor to do it. If not, I will open a new PR. |
Woah, that's quite the necro 😅 I'll see if I can find some time to remember what this was about and solve the merge conflict. (Note: I have two other PRs fixing other bugs that also have merge conflicts.) |
6e01cf0
to
0b6ab12
Compare
Fixed the formatting and also confirmed that test is indeed failing on c366ed1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you 💐
🎉 This PR is included in version 13.5.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
The
interceptorScopes()
function is used byactiveMocks()
andpendingMocks()
to retrieve the list of all scopes. That list is built by concatenating the scopes of every interceptor. When multiple interceptors are registered on the same scope, the scope will be returned multiple times, causingactiveMocks()
andpendingMocks()
to include duplicates.This PR fixes the issue by ensuring there is no duplicate returned by
interceptorScopes()
.Fixes #2352 (and #600, which also reported this issue)