Is there a way to have tests run within milliseconds of saving a file?

there are a bunch of filewatcher libraries, and the emacs repl and test runner could probably share the same process?

I believe kaocha supports a watch mode that doesn’t restart the REPL!

It’s also possible to run your tests directly from the REPL. Your editor might have built-in support – or you could call a function from your REPL that runs the tests.