karma-runner/karma — pull request #1123 by schmod (2014-07-02 18:47:25+00:00)
Title: refactor(watcher): Use gaze for FS watching

There are several issues surrounding file-watching (see #974), and it makes increasingly little sense to try to address all tricky edge cases within Karma, when there are existing libraries that tackle the "tough issues" for us.

This PR replaces chokidar with Gaze, which is a purpose-built globbing file watcher. Gaze has some of its own issues (particularly related to ST3), but largely seems to be more stable and reliable than Karma's old approach. Gaze is fairly widely used, and notbaly provides the underlying functionality for grunt-contrib-watch.

Additionally, we now watch files according to their relative paths (rather than the absolute path that config.js computes for us). This seems to prevent Gaze from inadvertently traversing filesystem boundaries (which hurts performance, and breaks the detection of new files).

Most unit tests in watcher.js were removed, because Gaze implements its own test suite, which doesn't need to be replicated here. If there's any functionality that you think should be tested, please leave a comment.

When this PR is merged, it may make sense to start cleaning up file_list.js, and removing globbing hacks wherever we can, and delegate that functionality out to an external library.