mercredi 26 juillet 2017

Jest test component's inner method

I'm using react native 0.40 with jest 20. When trying to test the inner method of a component I fail because I cannot get the instance of it and then call the method. I saw that many use enzyme, but I had problems configuring that with my app. Right now I'm just using "react-test-renderer" for some ui testing, I read that it should be possible to test an inner method by simply using the shallow functionality from "react-test-renderer". That doesn't seem to work either. So I'm wondering what's the best way to test a component inner method, and if the above methods are just not working for me because of some configurations problem. Thanks

Aucun commentaire:

Enregistrer un commentaire