How can I mock an ES6 module import using Jest?
I want to test that one of my ES6 modules calls another ES6 module in a particular way. With Jasmine this is super easy — The application code: // myModule.js import dependency from ‘./dependency’; export default (x) => { dependency.doSomething(x * 2); } And the test code: //myModule-test.js import myModule from ‘../myModule’; import dependency from … Read more