Bad 👎
expect(spyFunction).toReturn(expectReturn.id)
expect(spyFunction).toReturn(expectReturn.title)
expect(spyFunction).toHaveBeenCalledWith({
... /* very large object that I didn't care all of em */
})
Good 👍
expect(spyFunction).toReturn(expect.objectContain({
id,
title,
}))
expect(spyFunction).toHaveBeenCalledWith(
expect.objectContain({ ... /* some meaningful value */ })
)
Top comments (0)