steida/este-watch — pull request #5 by menssen (2014-12-20 22:09:15+00:00)
Title: Fix failing tests for ignore/filter patterns

Finally had some time to look into this. Four things.

1. Mysteriously, I started to see more failures when trying to run with a newer version of the gulp cli installed globally. This is probably just coincidence, but I went ahead and went through the dependencies and bumped versions of everything to try to keep things fresh.

2. I had the file creation for two of the tests in a beforeEach hook, but nothing explicitly waited for that time to pass, so if the test failed quickly I think those files were getting created while the *next* test was running. Or something like that. Point is, things were happening out of order.

3. I had the "watcher.dispose()" call after the assertions, so if one of the assertions failed with an exception, I don't think the watcher was being stopped, interfering with the next test.

4. After fixing all of the above, I was still seeing intermittent failures, but bumping all the time intervals to half a second seems to have fixed it.

Both #4 above and the setTimeout nesting are gross stylistically, but it seems to be the easiest way to see that everything is happening in the correct order.