visionmedia/mocha — pull request #398 by exogen (2012-04-23 11:00:58+00:00)
Title: Only add one postMessage listener. Fixes unresponsive browser during and after tests.

Since `addEventListener` is being called with a new function reference every time, the browser considers them unique event handlers and is calling more and more each time. This change just adds the handler once.

This is the cause of a sluggish browser even long after running a decently sized test suite (millions of `postMessage` handlers are still being run minutes later).

This also makes the progress smoother while the tests are being run. :D