Monitor file events in pathwatcher spec.
This commit is contained in:
parent
fff743053a
commit
bbc01e704c
1 changed files with 5 additions and 2 deletions
|
@ -22,8 +22,11 @@ describe 'third-party module', ->
|
|||
it 'emits file events correctly', (done) ->
|
||||
pathwatcher = require 'pathwatcher'
|
||||
temp.mkdir 'dir', (err, dir) ->
|
||||
watcher = pathwatcher.watch dir, (event) ->
|
||||
assert err == null
|
||||
file = path.join dir, 'file'
|
||||
fs.writeFileSync file, 'content'
|
||||
watcher = pathwatcher.watch file, (event) ->
|
||||
assert.equal event, 'change'
|
||||
watcher.close()
|
||||
done()
|
||||
fs.writeFile path.join(dir, 'file'), ->
|
||||
fs.writeFileSync file, 'content2'
|
||||
|
|
Loading…
Reference in a new issue