describe('looking for a new house', () => {
it('the house has my desired features', () => {
expect(houseForSale).toMatchObject(desiredHouse);
}
}
TypeError: expect(...).toMatchObject is not a function
this is with node v7.2.0
This is a duplicate of #2195 and it got me too a few days ago. Coming soon :)
The missing parens have been corrected on master in https://github.com/facebook/jest/commit/97a3ab6544a666c30418b86b9fc2ba14aa202b41
Thanks @pedrottimark for pointing to the duplicate!
@talkingtab you'll need to wait a little for the next release to use toMatchObject().
You can read about the reasons in the issue mentioned above.
Closing.
Is the "next release" available? I saw another thread implying that it's available by now, but I did an update and still get the error.
Release is scheduled for Thursday (tomorrow), so stay tuned!
Guys, happy new year, still can't use toMatchObject() :/
Please upgrade to Jest 18.
Guys, but I think a good idea would be to add require Jest 18+ to Asymmetric Jest Matchers section in the docs, I spent like 1 hour trying to make it work.
yes, we'll do this going forward.
Most helpful comment
Please upgrade to Jest 18.