How to mock dependencies for unit tests with ES6 Modules

后端 未结 5 1329
一整个雨季
一整个雨季 2020-12-02 11:58

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

5条回答
  •  没有蜡笔的小新
    2020-12-02 12:44

    I actually got this to work by dropping Jest and going with Karma + Jasmine + Webpack and using https://github.com/jhnns/rewire to mock dependencies

提交回复
热议问题