The primary issue is that Jest mocking only supports loading modules in the CommonJS format. The "haste module loader" within Jest could be refactored to support the ES6 module loader, but it would require making a lot of it async.
The babel-jest plugin exists, and it could be modified to spit out modules that use the System.register format. However, this still would result in an improperly configured loader.
My solution was to implement a systemjs-jest plugin that loads the JSPM config file and preprocesses the tests with the SystemJS builder: https://www.npmjs.com/package/systemjs-jest
The downside is that mocking in Jest doesn't work with this, unless you explicitly use "require" to pull in the dependencies you want mocked. This seems to defeat a lot of the purpose of using ES6 modules to begin with, so we may go back to using mocha/sinon at some point.
- Jason
In case someone reaches this thread looking for a solution to using Jest with a JSPM/SystemJS based app. I've created a Gulp plugin that generates the necessary Jest configuration based on the SystemJS config: https://www.npmjs.com/package/gulp-jest-jspm.
It can even be used without gulp by simply calling the getJestConfig() method and passing it to Jest.
As far as I know it doesnt have any drawbacks and allows to use Jest to the fullest.
Yoav