thingco / shared-frontend-libs

0 stars 0 forks source link

[FIX] - jest does not understand ES modules #12

Closed DanCouper closed 3 years ago

DanCouper commented 3 years ago

Which package does this affect?

Describe the bug Node doesn't have full support for ESModules. Jest uses Node. Therefore, any tests using any of these packages fails with a syntax error. Jest has experimental support for ESModules based on Node's experimental support, but using that means you cannot use module mocks in the tests.

To Reproduce Steps to reproduce the behavior:

Run tests in any project that imports any of these modules.

Expected behavior The tests pass

Additional context Changing the Typescript output to "commonjs" rather than "ESNext" will fix this, so all packages need to be rebuilt and republished.