commit e3e4803b7dde41dc8932ef8a99b492add2415393
Author: Tom Hughes <tom@compton.nu>
Date: Sun Nov 15 12:23:08 2015 +0000
Make sure test writes cover at least one second
As fs.stat in nodejs 0.10 only reports mtime with one second
resolution watchit it will, with debounce enabled, not report
any changes which occur in the same second as the initial mtime.
So if this test creates the file and does all the changes in
the same second then it will fail.
As a workaround we make sure the last change is over a second
after the initial creation time.
diff --git a/test/debounce.coffee b/test/debounce.coffee
index 1daf2bd..3d26e5f 100644
--- a/test/debounce.coffee
+++ b/test/debounce.coffee
@@ -12,10 +12,10 @@ describe 'watchit', ->
emitter.on 'change', -> changeCount++
delay ->
- for i in [0..500] by 10
+ for i in [0..1500] by 30
setTimeout (-> fs.writeFileSync file, "#{i}"), i
setTimeout ->
expect(changeCount).to.be(1)
done()
- , 1050
+ , 1750