lundi 16 octobre 2017

How can I stub/mock a function in a module called by another module in a test?

I am trying to test a function in module X. It is a fairly complex function. In this function, I import a function in Module Y that calls a third party service. How can I stub this 3rd party service in Module Y if my tests for module X don't import module Y?

Aucun commentaire:

Enregistrer un commentaire