]> Piment Noir Git Repositories - poolifier.git/commit
test: add custom toMatchObject matcher for @std/expect compatibility
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Sun, 22 Feb 2026 22:51:47 +0000 (23:51 +0100)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Sun, 22 Feb 2026 22:51:47 +0000 (23:51 +0100)
commit5b2ecea52bf01a9af1b8248f3ece243c75ac9594
tree1a59372e13a89de556e7e5229fae01516e1fb3c6
parent6395858a4fa7d13fe4361fdd9d899c4c4835298d
test: add custom toMatchObject matcher for @std/expect compatibility

Implement custom Vitest matcher that replicates @std/expect's toMatchObject
semantics for arrays. The matcher handles sparse array subset matching where
only defined indices are compared, matching the behavior of @std/expect's
spread-based algorithm in _equal.ts.

This fixes 8 failing tests in queue test files that use toMatchObject with
sparse arrays created via new Array(capacity).
tests/vitest.setup.mjs [new file with mode: 0644]
vitest.config.ts