My development process looks like this:
- run the watcher
- save a source/test file
- if the file is in /test/ dir, then the suite is ran
- if the file is in /src/ dir, then it is instrumented (and the instrumented source replaces require cache
- once the suite is done running, a coverage report (Istanbul ftw!) is built both in html and console versions.e
- Every save only takes a few milliseconds to generate the feedback/output, which is really important to me
It took some time, but got it working eventually: https://medium.com/@TomazZaman/how-to-get-fast-unit-tests-wi...
Now the question I have at this point is: Is it only me who has this kind of requirements? Because I've Googled a lot (A-LOT!) and there's simply no Javascript test optimization techniques out there. At least none people would write about.