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

Error in Unit test #12

Open
trevlar opened this issue Feb 25, 2022 · 1 comment
Open

Error in Unit test #12

trevlar opened this issue Feb 25, 2022 · 1 comment

Comments

@trevlar
Copy link

trevlar commented Feb 25, 2022

I'm seeing an error in my unit tests after adding Laika.

 import noop from 'lodash/noop';
    ^^^^^^

SyntaxError: Cannot use import statement outside a module

To produce this error I followed the instructions in the documentation.

Then I followed the instructions on linking it in a unit test.

https://zendesk.github.io/laika/docs/how-to-install/#loading-the-link-in-unit-tests

I am using TypeScript and have lodash as a dependency of my project.

@WonderPanda
Copy link

@trevlar Depending on your setup you probably want to import from @zendesk/laika/cjs/laika instead of @zendesk/laika/esm/laika since by default Jest doesn't know how to deal with ESM

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