Skip to content
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

"Cannot use import statement outside a module error" error when running unit tests (jest) #31

Open
jameshschuler opened this issue Oct 27, 2022 · 1 comment

Comments

@jameshschuler
Copy link

Hello I'm running into a SyntaxError: Cannot use import statement outside a module error when trying to run my vue 2 / jest unit tests. I added this to my jest.config but still getting the error. Seems like the ckeditor is trying to import code internally that isn't getting caught by the jest transpiling.

import { Editor, DataApiMixin, ElementApiMixin, attachToForm } from 'ckeditor5/src/core';

transformIgnorePatterns: [ '\\\\/node_modules\\\\/(?!@ckeditor).+\\.(js|jsx|ts|tsx|vue)$'],

@pomek
Copy link
Member

pomek commented Nov 2, 2022

Hi @jameshschuler, we are aware of issues running tests using Jest. You can read more about it in the React repository – ckeditor/ckeditor5-react#225.

In the comments section, you can find my comment where I could run a test, but it was prolonged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants