Comment

Comment by tzaman

Pretty amazing, but there's one feature all test runners seem to ignore, and that's persistent watching. And the ones that _do_ support it just run pretty much _everything_ on each save.

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.

parent tzaman 11 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton