DEV Community

Discussion on: Test Driven Development 101 and JS testing

Collapse
 
kayis profile image
K

"export class MyClass doesn’t work for nodejs. I have to use the module.exports keyword"

Yes, seems like ES modules are experimental in node 10.

They have to be manually activated with the --experimental-modules command line parameter and the module needs the .mjs extension :(

Collapse
 
cstroliadavis profile image
Chris

You can now use the esm module from Dalton to assist with this. "npm init esm"