teambit / envs

Component development environments for the Bit community
https://bit.dev/bit/envs
Other
63 stars 9 forks source link

ES6 module support for mocha #49

Open KutnerUri opened 4 years ago

KutnerUri commented 4 years ago

I am using Mocha tester as my default tester. Currently (v5.0.2), it only works with require('...'), aka CommonJS.

This was fine, but now new version of TS compiler outputs ESM(import/export) as /dist.

As a workaround, I'm setting override config to output as ES5/CommonJS.

So, Please support ESM natively in mocha. :)

KutnerUri commented 4 years ago

please prioritise

❯ bit test base/button 
successfully installed the bit.envs/testers/mocha@5.0.2 tester

bit.gui/base/button@0.0.6
tests failed
file: button.spec.js

✖ Cannot use import statement outside a module 
    Cannot use import statement outside a module