Skip to content

Commit

Permalink
fix(watcher): prevent Node crash when Karma exits
Browse files Browse the repository at this point in the history
`.close()` method returns a Promise now.

See fsevents/fsevents#314 (comment).

Fixes karma-runner#3511
  • Loading branch information
devoto13 committed Jan 18, 2021
1 parent 3653caf commit d5c02e7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/watcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ function watch (patterns, excludes, fileList, usePolling, emitter) {
.on('error', log.debug.bind(log))

emitter.on('exit', (done) => {
watcher.close()
done()
watcher.close().then(() => done())
})

return watcher
Expand Down

0 comments on commit d5c02e7

Please sign in to comment.