vitest-dev / vitest-dev/vitest
Order-sensitive diff on expect.arrayContaining failure
Open
Nobody has claimed this yet.
p2-to-be-discussed
pending triage
- Dominant language
- TypeScript
- Stars
- 17.1k
- Forks
- 2k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 94
Description
Describe the bug
Diff from failed expect.arrayContaining([...]) assertion is incorrectly order sensitive.
I expect that the diff should be order-agnostic, and correctly identify all matching elements.
Reproduction
https://stackblitz.com/edit/vitest-dev-vitest-92aubqtb
Used 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the linked StackBlitz reproduction for the expect.arrayContaining failure and trace the assertion's diff output. The fix is done when the diff is order-agnostic and correctly identifies all matching elements, with the existing reproduction or a corresponding test confirming the behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100