jest-codemods icon indicating copy to clipboard operation
jest-codemods copied to clipboard

Support chai includeDeepMembers

Open domoritz opened this issue 6 years ago • 2 comments

It would be great if the library supported https://www.chaijs.com/api/assert/#method_includedeepmembers

domoritz avatar Dec 11 '18 17:12 domoritz

PRs are more than welcome. Are you up for creating one? Codemods are fun to write. :)

skovhus avatar Dec 12 '18 00:12 skovhus

Unfortunately, I'm pretty swamped right now.

But I can suggest a translation I ended up applying by hand:

assert.includeDeepMembers(actual, [...expected])

should become for one expected value

expect(actual).toContainEqual(expected)

or this for multiple expected values

expect(actual).toEqual(expect.arrayContaining(expected))

domoritz avatar Dec 12 '18 00:12 domoritz