5 ms·
Usually you can do this by mocking that specific library out at the module level. E.g. Jest has functionality for this.
by danabramov 5y ago
Usually you can do this by mocking that specific library out at the module level. E.g. Jest has functionality for this.
- RussianCow 5y agoSure, but using Enzyme has been easier and far less brittle in my experience by being less reliant on hacky, library-specific mocking techniques. (Then again, I suppose you could argue that Enzyme is itself a giant hack, but it worked very well for me in the past.)