Closed leoferreiralima closed 6 months ago
I'm not sure if this is a good idea, it feels a little unexpected to automatically mock such direct imports from cross-fetch. And I worry that it would break or conflict with the examples of conditional mocking at the end of the README.
In your issue, you showed two different ways to work around the problem of direct imports not being mocked. I wonder if the better solution here is to update the README to clarify the current behavior and present the two approaches you mentioned so that users can set up the mocks themselves if they desire.
What do you think? I'll leave this open for a while and give others a chance to chime in as well, since honestly I don't use this library extensively and maybe I'm missing some context.
All that said, thanks for the issue and the contribution!
I think is a good option update the read with this context, other alternative is use other method to activate this mock, becaus i think this should be support by the library some way, maybe a method named enableDirectImport()
to run this and the users can option to call or not this method as they wish
Added fix to reported issue #13
fix #13