Learn Docker With My Newest Course

Dive into Docker takes you from "What is Docker?" to confidently applying Docker to your own projects. It's packed with best practices and examples. Start Learning Docker →

Using vim-test to Run Your Tests with and without Docker

blog/cards/using-vim-test-to-run-your-tests-with-and-without-docker.jpg

This Vim plugin lets you run one test, a full file or all of your tests for 20+ programming languages and test runners.

Quick Jump: Demo Video

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

Are you using this plugin to run your tests? Let me know below.

Never Miss a Tip, Trick or Tutorial

Like you, I'm super protective of my inbox, so don't worry about getting spammed. You can expect a few emails per month (at most), and you can 1-click unsubscribe at any time. See what else you'll get too.



Comments