-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
toEqual Map/Set sort order with object keys/values #6138
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
Comments
The test cases presented seem straightforward, i.e. no duplicate deep equal array or object. However, there are some edge cases when dealing with the presence of such values in a data structure where order does not matter, i.e. in Set and Map. For instance, const expected = new Set([
[1],
[2],
[2]
])
const actual = new Set([
[2],
[1],
[2]
]) What would be the expected outcome for the above comparison? I checked them out using Lodash and Underscore’s |
@donysukardi I am a bit confused by your response. These tests are all regarding const expected = new Set([
1,
2,
2
])
const actual = new Set([
2,
1,
2
]) See #4286 and #4303 for more reasoning why this is the case. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
🐛 Bug Report
Set
as an object andMap
with an object key does not ignore sort order.Relevant issues and PR: #4286 #4303 (comment)
To Reproduce
Expected behavior
Sort order does not matter. Both above tests pass.
Link to repl or repo (highly encouraged)
https://github.com/chrisblossom/jest-issue-6138
Run
npx envinfo --preset jest
Paste the results here:
The text was updated successfully, but these errors were encountered: