<p>In Vim-land, I use the <a href="https://www.github.com/janko-m/vim-test">vim-test plugin</a> for quickly executing tests from a command line shortcut<sup id="fnref1"><a href="#fn1">1</a></sup>. I wanted to reproduce this behavior in <a href="https://code.visualstudio.com">Visual Studio Code</a>, but I couldn’t find an extension that worked in multiple languages (namely, Ruby, Elixir, Javascript, and Elm). I’m mostly just using VSCode for Elixir, but I still liked the idea of finding a more general purpose solution.</p> <p>So instead I used VSCode’s support for <a href="https://code.visualstudio.com/docs/editor/tasks">Tasks</a> to build the functionality myself. So in my project’s <code>tasks.json</code> file, I have the following 3 tasks for running all tests, a single...</p>
Blog Entries tagged "testing"
<p>In order for testing to become part of your development workflow, it needs to become a habit. And like any habit, its biggest enemy is neglect. Too often I’ll be in a rush and not add tests to my code for a day, and that turns into a week and then a month, and suddenly I have an app where half of my codebase is untested and the other half has breaking tests. There are many things you can do to help keep this habit (hooking up a CI server immediately comes to mind), but an important one is to make running your tests as quick and easy as possible.</p> <p>One way I do this is by making my ruby tests (either Rspec or Minitest) extremely easy to run while I’m using <a href="http://www.vim.org">Vim</a> (and <a href="https://tmux.github.io">Tmux</a>). With one quick keystroke, I can run the current test file or individual test in a new Tmux pane.</p> <p></p>