I'm currently undergoing a 9-month-long in-place rewrite of testdouble.js (which has proven to be a really stupid idea, but mildly entertaining at least).
This morning, my goal was to break down the responsibilities of the totally not unit-tested td.verify() function with a number of smaller modules which are test-driven with an outside-in approach.
I get a bunch of questions about how I "actually" do this, so I logged each step I took in a separate commit. You can see the 9 steps I took, including the final step—realizing that the contract I'd created was not how I wanted, refactoring one of the dependencies' contracts before it had even been written!