-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jest has an issue when trying to import the library #99
Comments
Hi, this is likely an issue with Jest configuration. AFAIK it has some issues with using ES modules. Lines 16 to 17 in d2afae1
Here is an example of using |
Got it working by using one of the approaches from https://gist.github.com/rstacruz/511f43265de4939f6ca729a3df7b001c Method A got rid of the issue by:
|
Thanks for sharing! I will try it myself and consider adding this solution to README. The only thing that looks confusing is the need for dynamic import. |
@web-padawan I spoke too soon. When running jest in CI, getting memory leak. Possibly the same issue as on either of these: |
Current Behavior
When trying to run Jest in a repo that is importing vanilla-colorful, I get the following error message: "Cannot use import statement outside a module"
Steps to Reproduce
Context (Environment)
Detailed Description
Currently I am importing vanilla-colorful in to a Vue project. When I try to run Jest I get the following error message:
I have tried what Jest suggests; adding experimental decorators and get the following message:
I have also tried tried adding vanilla-colorful as a custom transformIgnorePattern.
Any insight on this would be appreciated, thanks.
The text was updated successfully, but these errors were encountered: