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]: expect.toMatchObject ignores symbol key properties #13638

Closed
aduponchel opened this issue Nov 24, 2022 · 3 comments · Fixed by #13639
Closed

[Bug]: expect.toMatchObject ignores symbol key properties #13638

aduponchel opened this issue Nov 24, 2022 · 3 comments · Fixed by #13639

Comments

@aduponchel
Copy link

Version

29.3.1

Steps to reproduce

test('foo', () => {
    expect({}).toMatchObject({ [Symbol('foo')]: true });
});

Expected behavior

Use .toMatchObject to check that a JavaScript object matches a subset of the properties of an object.

{} does not contains Symbol('foo') so assertion should fail

Actual behavior

test passes

Additional context

Seems to be already reported by #6466
However issue is closed

Environment

System:
    OS: Linux 5.10 Ubuntu 22.04.1 LTS 22.04.1 LTS (Jammy Jellyfish)
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
  Binaries:
    Node: 18.12.1 - ~/.nvm/versions/node/v18.12.1/bin/node
    Yarn: 1.22.19 - /mnt/c/Program Files/nodejs/yarn
    npm: 8.19.2 - ~/.nvm/versions/node/v18.12.1/bin/npm
  npmPackages:
    jest: ^29.3.1 => 29.3.1
@github-actions
Copy link

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.

@SimenB
Copy link
Member

SimenB commented Jan 24, 2023

https://github.com/facebook/jest/releases/tag/v29.4.0

@github-actions
Copy link

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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants