Sometimes I do this with automated testing, but I'll admit that sometimes I don't. I never regret the time to set it up as automated testing early, though.
I try to finish by day 8, which means that I won't actually finish then but in the last 2 days I'm taking care of the fiddly bits (more elegant error handling, logging if necessary, weird edge cases), basically things I didn't even think of needing to do when I started. So, I plan to finish by day 8 so that I have some time left for things that were not initially in scope which (for whatever technical, business, or political reason) cannot be left out in version 1.