Skip to content
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

[Bug]: toMatchObject incorectly handles nulls in lists of sets #14599

Closed
gorbak25 opened this issue Oct 4, 2023 · 11 comments · Fixed by #14873
Closed

[Bug]: toMatchObject incorectly handles nulls in lists of sets #14599

gorbak25 opened this issue Oct 4, 2023 · 11 comments · Fixed by #14873

Comments

@gorbak25
Copy link

gorbak25 commented Oct 4, 2023

Version

29.7.0

Steps to reproduce

For this match

expect([null]).toMatchObject([new Set()]);

Expected behavior

It should throw an exception

Actual behavior

But it doesn't throw an exception. What's interesting is that

expect(null).toMatchObject(new Set()); 

behaves as expected.

Additional context

No response

Environment

System:
    OS: Linux 6.1 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
    CPU: (8) x64 Intel(R) Core(TM) i5-8365U CPU @ 1.60GHz
  Binaries:
    Node: 20.6.1 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 9.8.1 - /usr/local/bin/npm
    pnpm: 8.7.5 - /usr/local/share/npm-global/bin/pnpm
  npmPackages:
    jest: ^29.7.0 => 29.7.0
Copy link

github-actions bot commented Nov 3, 2023

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Nov 3, 2023
@gorbak25
Copy link
Author

gorbak25 commented Nov 3, 2023

Is this a bug or expected behaviour?

@github-actions github-actions bot removed the Stale label Nov 3, 2023
Copy link

github-actions bot commented Dec 3, 2023

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Dec 3, 2023
Copy link

github-actions bot commented Jan 2, 2024

This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 2, 2024
@SimenB SimenB reopened this Jan 2, 2024
@SimenB
Copy link
Member

SimenB commented Jan 2, 2024

Deffo a bug - PR welcome! 😀

Copy link

github-actions bot commented Feb 1, 2024

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Feb 1, 2024
@ofekm97
Copy link
Contributor

ofekm97 commented Feb 11, 2024

@SimenB
Will appreciate a review on the PR linked above 🙌

@github-actions github-actions bot removed the Stale label Feb 11, 2024
@ofekm97
Copy link
Contributor

ofekm97 commented Mar 5, 2024

@SimenB kindly reminder 😄

@ofekm97
Copy link
Contributor

ofekm97 commented Mar 10, 2024

@bensternthal / @cpojer would appreciate a review on the PR 🙌

Copy link

github-actions bot commented Apr 9, 2024

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Apr 9, 2024
@ofekm97
Copy link
Contributor

ofekm97 commented Apr 9, 2024

bump

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants