lundi 12 février 2018

Jest spyOn-function returns "'_isMockFunction' of undefined"

I'm trying to test a React-Component.

I call a function during componentDidMountand want to test that it is called.

Unfortunately I get an error when I want to run the test:

Cannot read property '_isMockFunction' of undefined

I tried to reproduce a minimal example here:

https://codesandbox.io/s/xoy59yr34z

Any hints as to why this error occurs would be appreciated. :)

Aucun commentaire:

Enregistrer un commentaire