Can't figure out how to resolve these errors yet, Jest is complaining about dynamic imports like these:
const importModules = Promise.all([
import('containers/HomePage/reducer'),
import('containers/HomePage/sagas'),
import('containers/HomePage'),
]);
Error message:
F:\react-boilerplate\app\store.js:49
import('./reducers').then(function (reducerModule) {
^^^^^^
SyntaxError: Unexpected token import
You can find all of the details here: https://github.com/mxstbr/react-boilerplate/pull/1358
.babelrclooks like?env.testsettingsbabel-plugin-dynamic-import-nodeplugin to the list of plugins in test environment and the error was resolved for the most parts. I guess dynamicimport()s can't be polyfilled so the only choice for node is to transform them torequireinside aPromise.