/ testing

Testing Friction

One of the barriers to entry for writing tests is the "ergonomics" of our tools. Requiring too much ceremony or boilerplate for every test will put off even the most enthusiastic testers.

One of the reasons testing is common in Ruby land is tools do a lot of the setup/tear down for you. A lot of this comes from tight integration of libraries like Rails, RSpec, FactoryBot.

In JavaScript land, things are decoupled, and you need to do too much setup/configuration.

To have a sound testing story, you need to build your testing tools to integrate the different parts. Writing tests should be frictionless so that you can focus only on testing logic.

The second friction point in testing is speed - If it's faster to run the test, I'll do it more often. Having to wait makes you test less frequently. The best tooling investment I ever did is integrate vim-test and run the current test from my editor with a simple shortcut.