Warning. This note is about using mocha 6 and typescript. It will not work in mocha 5.x and lower and pure JS. But you can easily adapt it to your use cases.
How do you write tests for your typescript code? I prefer to write code and run test in one time in background on the second monitor. Mocha allows to do it with — watch option and you can add next script to your package.json:
Ok, now you can run it in the terminal and watch your tests:
npm run-script watch-tests
It looks good and pretty easy, but…
Default workflow RustDT (built upon Eclipse) is not very good for building small executables. When you learn new language, you want to build many small executables. And you don’t want to waste your time on IDE’s strange behavior: