visionmedia/mocha — pull request #1100 by benjie (2014-01-04 14:27:09+00:00)
Title: Abort previous run on --watch change.

Currently when a file change is detected the previous test suite continues running and a new one starts in parallel. This can cause issues with the context sharing issue fixed in #1099; but I also suspect it's not the desired behaviour.

This change aborts the current test suite before starting the fresh one.

(An alternative option would be to queue a new test suite run after the current one completes - I am not sure which is the more desirable option; I think running the fresh tests sooner probably wins from the point of view of giving the programmer up to date feedback?)