mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Use a private utility function to wait for all native watchers to stop
This commit is contained in:
@@ -46,7 +46,7 @@ TextBuffer = require 'text-buffer'
|
||||
Gutter = require './gutter'
|
||||
TextEditorRegistry = require './text-editor-registry'
|
||||
AutoUpdateManager = require './auto-update-manager'
|
||||
FileSystemManager = require './filesystem-manager'
|
||||
FileSystemManager = require('./filesystem-manager').default
|
||||
|
||||
# Essential: Atom global for dealing with packages, themes, menus, and the window.
|
||||
#
|
||||
|
||||
@@ -222,3 +222,11 @@ export default class FileSystemManager {
|
||||
return watcher
|
||||
}
|
||||
}
|
||||
|
||||
// Private: Return a Promise that resolves when all {NativeWatcher} instances associated with a FileSystemManager
|
||||
// have stopped listening. This is useful for `afterEach()` blocks in unit tests.
|
||||
export function stopAllWatchers (manager) {
|
||||
return Promise.all(
|
||||
Array.from(manager.liveWatchers, watcher => watcher.stop())
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user