A test double is an object or function that behaves like a real piece of code, but is, instead, solely for a test. It mimics the functionality of something, without being that something. There are plenty of frameworks to deal with test doubles in JavaScript (like sinon), but it's helpful to the various types of… Continue reading Building Your Own (JavaScript) Test Doubles
Category: Testing
What to Put in Test Docblocks
There's a great article on dockblocks in tests that has some really good advice. Sometimetimes a good test name isn't enough and there should be some more context. Here are some other things I like to put in PHPUnit test docblocks. For Bugs & Bug Fixes In other words, I like to put the bug… Continue reading What to Put in Test Docblocks
Improving Tests One Name at a Time
Let's take a look at a simple object and a typical test. The code examples here are PHP, but this advice applies to any language or testing framework. Looks great right? I would argue that the test, while valid, is not as useful as it could be because the name of the test is terrible.… Continue reading Improving Tests One Name at a Time