mirror of
https://github.com/atom/atom.git
synced 2026-01-25 14:59:03 -05:00
Only resolve the waitForChanges promise once
This commit is contained in:
@@ -29,6 +29,7 @@ describe('FileSystemManager', function () {
|
||||
|
||||
function waitForChanges (watcher, ...fileNames) {
|
||||
const waiting = new Set(fileNames)
|
||||
let fired = false
|
||||
const relevantEvents = []
|
||||
|
||||
return new Promise(resolve => {
|
||||
@@ -39,7 +40,8 @@ describe('FileSystemManager', function () {
|
||||
}
|
||||
}
|
||||
|
||||
if (waiting.size === 0) {
|
||||
if (!fired && waiting.size === 0) {
|
||||
fired = true
|
||||
resolve(relevantEvents)
|
||||
sub.dispose()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user