Unexpected token ‘import’ error while running Jest tests?

You just need to make sure that vue-awesome will be transformed by jest, so add
following to your jest config:

transformIgnorePatterns: ["/node_modules/(?!vue-awesome)"],

which means: “Ignore everything in node_modules except for vue-awesome.

Also here is exhausive list of other issues that might cause this error: https://github.com/facebook/jest/issues/2081

Leave a Comment