Closed Mourdraug closed 6 years ago
I'm not familiar with Jest, but it sure sounds like whatever you're using doesn't recognize ES6 code like imports/exports. Perhaps it's an order-of-execution thing, like you need to transpile things to ES5 first, then run those tests(?)
It might be order-of-execution kind of issue, but it's kinda weird, because import statement itself works (otherwise it'd throw Unexpected token import
instead), error actually occurs further down the stack trace.
I'm working with vue and jest unit tests. I'm checking out how it all works together and I can't run my tests. When importing TweenLite like so:
import TweenLite from 'gsap/TweenLite'
I get:I'm using
babel-jest
and other ES6 imports seem to work fine. Everything works just fine in development server as well, it only crashes in unit tests.