fix: not addressing to Sets and Maps as object without keys#14873
Merged
SimenB merged 2 commits intojestjs:mainfrom Apr 30, 2024
Merged
fix: not addressing to Sets and Maps as object without keys#14873SimenB merged 2 commits intojestjs:mainfrom
SimenB merged 2 commits intojestjs:mainfrom
Conversation
✅ Deploy Preview for jestjs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
1557ff2 to
769fa58
Compare
ofekm97
commented
Jan 29, 2024
| !(a instanceof Date) && | ||
| !(a instanceof Set); | ||
|
|
||
| export const subsetEquality = ( |
Contributor
Author
There was a problem hiding this comment.
In case of subset as a Set the getObjectKeys(subset) at line 358 returns empty array ([]), so the .every(...) in the same line is vacuous truth, resulting the comparison not to raise an exception
769fa58 to
bd31657
Compare
bd31657 to
e35b950
Compare
SimenB
reviewed
Apr 4, 2024
e35b950 to
05ccc77
Compare
05ccc77 to
7d6586d
Compare
7d6586d to
f2346a7
Compare
Contributor
Author
|
@SimenB Hey, I see one of the tests failed after the squash - is there an option to rerun it only? 🙌 |
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #14599
The problem is that comparing list of nulls with Set or list of Sets:
In both cases the comparison does not throw an exception.
Update:
Same issue is happening with Map instead of set, I have fixed it too
Test plan
Unit tests added
Both cases described in the Summery have been tested locally with the fix and reproduced without the fix