In my experience, after code is checked in, unit tests have two main purposes:
1. Checking that functions aren't completely broken in dynamically typed languages (i.e. a check so basic that a static type checker can do its job) 2. Allowing programmers to refactor code without being terrified it will break something far away in the execution path
And like, that's it. That's enough to make them useful to have around.