mercredi 19 août 2020

shallow test react with enzyme with redux Provider

hello guys i am just asking this question to know if there any way to test a component wrapped with context like redux Provider with react using shallow render from enzyme .

well using mount will work like this:

const dom = mount(<Provider store={store}><Component/></Provider>) 

but the mountwill render all component tree even if i don't need to test them.

i tried to add dive to shallow render but it's seem this doesn't work with current react version.

any help would be appreciated.

Aucun commentaire:

Enregistrer un commentaire