How to mock dependencies for unit tests with ES6 Modules
问题 I'm trying to fiddle with Ecmascript 6 modules using webpack + traceur to transpile to ES5 CommonJS, but I'm having trouble successfully unit testing them. I tried using Jest + traceur preprocessor, but the automocking and dependency names seem to get screwy, plus I can't seem to get sourceMaps to work with Jest and node-inspector debugging. Is there a better framework to unit test ES6 modules? 回答1: I've started employing the import * as obj style within my tests, which imports all exports