Error in Unit test
Opened this issue · 1 comments
trevlar commented
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 commented
@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