paulmillr/chokidar — pull request #71 by es128 (2013-11-21 14:59:52+00:00)
Title: Fix ignoreInitial and tests

`npm test` was failing, so I set out to fix that. Once I did, discovered two tests were failing.

```
1) chokidar watch options ignoreInitial should notice when a file appears in an empty directory:
expected spy to have been called exactly once, but it was called 0 times

2) chokidar watch options ignoreInitial should check ignore after stating:
Error: EEXIST, file already exists '/Users/eshanker/Code/chokidar/test/fixtures/subdir'
```

With the first, I think it uncovered a bug with the `ignoreInitial` setting, at least my understanding of the intended behavior. It was always passing `initial=true`, now it only does that on the first invocation of `add`. The test now passes without modification.

The second failing test passed if the prior one was skipped. Some sort of race condition with the creation/removal of `subdir`. I didn't really solve the underlying race condition, but I'm not sure that's important. The test does pass now.