DEV Community

Discussion on: Mocha/Chai with TypeScript

Collapse
 
matteobruni profile image
Matteo Bruni

If you are on Windows env needs to be replaced with set, at least this is what I've read googling around.
That command is related to ts-node as you can read here

Collapse
 
johanneshayry profile image
johanneshayry

I have been using npmjs.com/package/cross-env for cross platform support

Collapse
 
belingheri profile image
Belingheri • Edited

Yes, but i had to add &&.
set TS_NODE_COMPILER_OPTIONS={\"module\": \"commonjs\" } && mocha -r ts-node/register 'tests/**/*.ts'

Thread Thread
 
brainafesoh profile image
brainafesoh

Damn windows, I just wasted the last 24hrs just because of this😩!
Thanks a lot.