diff --git a/package-lock.json b/package-lock.json index 06fb1917d..797c3f7aa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -744,9 +744,9 @@ } }, "@atom/notify": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@atom/notify/-/notify-1.0.3.tgz", - "integrity": "sha512-ZS+feBkSULIDQIQnYr4OdplH7UNzpAwHqv9dsfDjgtALuLVUnzL2SdBkvjX5LTMGiZkFRLs3Cbly25LdNGIBlQ==" + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@atom/notify/-/notify-1.0.4.tgz", + "integrity": "sha512-9tIf60zM0MSyEHzlH3NrMUeC6BJNrJyIzvLXK/UaW9HEeXWRayxBOGNkrKN9JfEYuabOsDoNdVqdo8HE16Wpfw==" }, "@atom/nsfw": { "version": "1.0.18", diff --git a/package.json b/package.json index 02d3a16eb..a58206fa2 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "license": "MIT", "electronVersion": "2.0.18", "dependencies": { - "@atom/notify": "1.0.3", + "@atom/notify": "1.0.4", "@atom/nsfw": "1.0.18", "@atom/source-map-support": "^0.3.4", "@atom/watcher": "1.3.1", diff --git a/spec/project-spec.js b/spec/project-spec.js index cabec7db1..4e4b5838e 100644 --- a/spec/project-spec.js +++ b/spec/project-spec.js @@ -59,7 +59,7 @@ describe('Project', () => { }) }) - it('does not deserialize paths that are now files', () => { + it('does not deserialize paths that are now files', async () => { const childPath = path.join(temp.mkdirSync('atom-spec-project'), 'child') fs.mkdirSync(childPath) @@ -70,22 +70,21 @@ describe('Project', () => { grammarRegistry: atom.grammars }) atom.project.setPaths([childPath]) + await stopAllWatchers() const state = atom.project.serialize() fs.rmdirSync(childPath) fs.writeFileSync(childPath, 'surprise!\n') let err = null - waitsForPromise(() => - deserializedProject.deserialize(state, atom.deserializers).catch(e => { - err = e - }) - ) + try { + await deserializedProject.deserialize(state, atom.deserializers) + } catch (e) { + err = e + } - runs(() => { - expect(deserializedProject.getPaths()).toEqual([]) - expect(err.missingProjectPaths).toEqual([childPath]) - }) + expect(deserializedProject.getPaths()).toEqual([]) + expect(err.missingProjectPaths).toEqual([childPath]) }) it('does not include unretained buffers in the serialized state', () => { diff --git a/src/path-watcher.js b/src/path-watcher.js index f4a77957a..a3357e6ab 100644 --- a/src/path-watcher.js +++ b/src/path-watcher.js @@ -606,13 +606,12 @@ class PathWatcherManager { // Private: Stop all living watchers. // // Returns a {Promise} that resolves when all native watcher resources are disposed. - stopAllWatchers () { + async stopAllWatchers () { if (this.useExperimentalWatcher()) { - this.notifyWatcher.kill() + await this.notifyWatcher.kill() this.notifyWatcher = null - return Promise.resolve() } else { - return Promise.all( + await Promise.all( Array.from(this.live, ([, w]) => w.stop()) ) }