Files
pezkuwi-dev/packages
Satoshi Qazi Muhammed 71c6f83ba0 dev-test: asymmetric matchers in .toEqual; arrayContaining checks entries
.toEqual compared with assert.deepEqual and never looked at matchers, so
expect(x).toEqual(expect.arrayContaining(...)) or
.toEqual(expect.stringContaining(...)) always failed; matchers only
worked inside toHaveBeenCalledWith. arrayContaining was also typed to
take a string and checked value.includes(theWholeArray).

.toEqual (and .not.toEqual) now apply matchers wherever they appear in
the expected value, with the previous deepEqual unchanged when there
are none; arrayContaining asserts that every expected entry equals (or
matches) one of the array's entries. Seven new cases; with the old
.toEqual six of them fail.
2026-10-10 06:36:44 +04:00
..