-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Copy link
Labels
p2-to-be-discussedEnhancement under consideration (priority)Enhancement under consideration (priority)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
The following tests should fail, but do not:
import { expect, test } from 'vitest'
test.fails('null does not match map', () => {
expect(null).toMatchObject(new Map([[1, 2]]));
})
test.fails('null does not match set', () => {
expect(null).toMatchObject(new Set([[1]]));
})Reproduction
https://stackblitz.com/edit/vitest-dev-vitest-y9khowyu?file=test%2Fbasic.test.ts
System Info
System:
OS: macOS 15.7.3
CPU: (14) arm64 Apple M4 Pro
Memory: 6.79 GB / 48.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 25.2.1 - /opt/homebrew/bin/node
npm: 11.7.0 - /opt/homebrew/bin/npm
Browsers:
Firefox: 146.0
Firefox Nightly: 149.0a1
Safari: 18.6
npmPackages:
@vitejs/plugin-react: ^5.1.1 => 5.1.1
@vitest/coverage-v8: ^4.0.14 => 4.0.14
vitest: ^4.0.9 => 4.0.14Used Package Manager
npm
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
p2-to-be-discussedEnhancement under consideration (priority)Enhancement under consideration (priority)p3-minor-bugAn edge case that only affects very specific usage (priority)An edge case that only affects very specific usage (priority)
Type
Projects
Status
P2 - 3