Skip to content

objectContaining is not considering Symbols #8170

@kamtschatka

Description

@kamtschatka

Describe the bug

We have some tests that use objectContaining to check if a Symbol is on the object.
The tests were all successful, when I expected them to fail after some changes I made.
After some debugging I figured out, that objectContaining does not seem to compare Symbols.

Reproduction

Stackblitz reproducer

System Info

System:
    OS: Windows 11 10.0.26100
    CPU: (16) x64 Intel(R) Core(TM) i9-10885H CPU @ 2.40GHz
    Memory: 18.85 GB / 63.64 GB
  Binaries:
    Node: 22.12.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.9.0 - C:\Program Files\nodejs\npm.CMD
    pnpm: 10.6.4 - C:\Program Files\nodejs\pnpm.CMD
  Browsers:
    Edge: Chromium (134.0.3124.85)
    Internet Explorer: 11.0.26100.1882
  npmPackages:
    @vitest/coverage-v8: catalog: => 3.1.2
    @vitest/ui: catalog: => 3.1.2
    vitest: catalog: => 3.1.2

Used Package Manager

pnpm

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions