Testing my code
Most of my work day I fix issues on websites. Sometimes huge ones with some complexity, most times minor fixes and upgrades. However, I do take pride in creating code which lasts and works, even when the user does something unexpected. So I test. And I test a lot.
There are many tools available to help you write tests both smarter and faster. One is the small library htmls, created by Espen A. Kristiansen and released under under a BSD3-clause. Here I can check if css-classes are included in a template. I can count the css-class, get the text of the html or their attributes.
By using the hmtls library my code quality significantly increases and it make me certain that the new code I add to a project doesn’t mess up existing code written by one of my colleagues.