lundi 9 octobre 2017

What is the difference between containMatchingElement and contain in chai-enzyme?

I have the following in the tests of a React component using chai-enzyme:

const wrapper = mount(<Something />)
expect(wrapper).to.contain(<SomethingElse />) //works
expect(wrapper).to.containMatchingElement(<SomethingElse />) //does not work

and wonder why contain works but containMatchingElement does not.

Aucun commentaire:

Enregistrer un commentaire