3 ms·
> I have written tests in TypeScript, compiled to JavaScript, and then used Mocha, for example, to run tests. I would like to hear your thoughts on this. We us
by lloyd-christmas 10y ago
> I have written tests in TypeScript, compiled to JavaScript, and then used Mocha, for example, to run tests. I would like to hear your thoughts on this.
We use ts-node to run our mocha tests without ever compiling: https://github.com/TypeStrong/ts-node https://github.com/TypeStrong/ts-node
- ihsw 10y agoAnother vote for ts-node running your tests, it makes things a lot simpler. Running tests directly instead of running compiled tests is faster and more reliable.
- camwest 10y agots-node has some issues with source maps unfortunately. When your project gets big enough you might want to move back to ts->js then running mocha.
- lloyd-christmas 10y agoMind being a bit more specific with "has some issues"? Our project isn't exactly small, and we haven't bumped into a problem yet. I'd really like to know what to expect if something is about to jump out from behind a wall.
- Tx3 10y agoInteresting solution, thank you for the link!