Using vim-test to Run Your Tests with and without Docker
This Vim plugin lets you run one test, a full file or all of your tests for 20+ programming languages and test runners.
It’s really convenient to be able to hit a hotkey and run your tests straight from within Vim, especially running 1 test at a time based on where your cursor is.
The vim-test plugin lets you do this, and it’s really easy to customize which test runner to use and the command that gets executed. That makes it possible to get it working with Docker without any fuss.
In this video we’ll go over using this plugin in a few different ways and go over how to customize the key mappings and a few test runners.
# Demo Video
Timestamps
- 0:21 – vim-test supports 20+ programming languages and lots of test libraries
- 0:46 – It’s easy to customize the commands, so it works with and without Docker
- 1:02 – Using the plugin in a Python app (but it works the same everywhere)
- 1:09 – Running a specific test in a file
- 2:30 – Running an entire file’s worth of tests
- 2:54 – Running all of the tests in your project
- 3:39 – Visiting the last test that you ran while doing something else
- 4:17 – Running the last test from anywhere in your code base
- 5:07 – Changing the Vim mappings if you don’t like what I’m using
- 5:56 – Customizing how your test’s output is shown within Vim
- 7:33 – Customizing a test runner to work with or without Docker
- 10:58 – Installing the vim-test plugin
Reference Links
- https://github.com/vim-test/vim-test
- Build a SAAS App with Flask course
- vim-test settings in my
.vimrc
file - https://github.com/nickjj/docker-rails-example
Are you using this plugin to run your tests? Let me know below.