-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
p3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)
Description
Describe the bug
When comparing Sets within expect.objectContaining, any Set will make the test pass. In other words, the line expect({ set: new Set() }).toEqual(expect.objectContaining({ set: new Set([1]) })); does not cause the test to fail.
Reproduction
https://stackblitz.com/edit/vitest-dev-vitest-dpdxnv?file=test%2Fbasic.test.ts
System Info
System:
OS: macOS 15.0.1
CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
Memory: 34.01 MB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.11.1 - ~/.nvm/versions/node/v20.11.1/bin/node
Yarn: 1.22.22 - /usr/local/bin/yarn
npm: 10.2.4 - ~/.nvm/versions/node/v20.11.1/bin/npm
Browsers:
Brave Browser: 128.1.69.168
Chrome: 109.0.5414.87
Edge: 130.0.2849.56
Safari: 18.0.1
Safari Technology Preview: 18.0Used Package Manager
yarn
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
p3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)