The most intuitive way for me to run tests is to use a tmux split pane. I simply split my screen between my editor and a shell that runs tests (
npm test in this example). I've then set up a vim hotkey (
,r for me) to quickly send "up enter" to the last tmux pane used.
Even better, I've set up
Ctrl-S as a "save-and-repeat" key to make it all happen in one keystroke:
Alternatively, you can use vim-dispatch, but it doesn't support colors and can be disorienting.