I was trying to write a spec that tests the listening for keyboard events, but the asynchronous nature of events made it difficult to do this in jasmine and phantom. This was my attempt at it.