A Jasmine TDD example. Look at the branches for the progression from one behavior, to 2, then to refactored passing tests all the way.
master - Initial Version with basic functionality.
final-before-refactor-version - We now handle surplus messages correctly.
final-version - Refactored for cleanliness, de-duplication, and readability.