I test Vue project with jest, bug I got errors says:
Jest encountered an unexpected token and SyntaxError: Unexpected token import
Most probably when updating package dependency, "babel-core"
dependency may have been updated to 6.xx.x
, it should be "7.0.0-bridge.0"
for jest to work.
Reference: https://github.com/vuejs/vue-cli/issues/1879#issuecomment-412300256 https://github.com/vuejs/vue-cli/issues/1879#issuecomment-435194932
I had a similar problem and "babel-plugin-transform-es2015-modules-commonjs" is working for me
npm i -D babel-plugin-transform-es2015-modules-commonjs
.babelrc config
"plugins":["transform-es2015-modules-commonjs"]