Instant test feedback with vim-test

vasily

Vasily Polovnyov

Posted on January 20, 2021

Instant test feedback with vim-test

Alt Text

I'm a huge fan of instant feedback in tests: the faster I get test results, the faster I get back to the code, the faster I get work done. To do this, I use watchers: in Ruby Guard tracks changes in files and automatically runs the right specs, in JavaScript jest --watch does it.

Over time, watchers began to annoy me: you save the file, the test runs after two seconds. Those two seconds are an eternity. Often you think you haven't saved the file, you save it again. The test runs a couple more times.

So I switched to running the tests manually but instantly with vim-test:
https://github.com/janko/vim-test

The idea is simple: save the spec, hit "space t" (space is a leader), immediately get a terminal with the test results. Awesome instant feedback.

P. S. I use these shortcuts to run the tests:

nnoremap <silent> <Leader>t :TestFile<CR>
nnoremap <silent> <Leader>s :TestNearest<CR>
nnoremap <silent> <Leader>l :TestLast<CR>
Enter fullscreen mode Exit fullscreen mode
💖 💪 🙅 🚩
vasily
Vasily Polovnyov

Posted on January 20, 2021

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related