Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Commit

Permalink
Make WatchmanClient test exit
Browse files Browse the repository at this point in the history
  • Loading branch information
Jess Lin committed May 30, 2015
1 parent cd2d956 commit dc7d1c5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/nuclide/server/lib/services/WatchmanClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ class WatchmanClient {
this._watchmanVersionPromise = this.version();
}

dispose() {
if (this._client) {
this._client.end();
}
}

_initWatchmanClient() {
var client = this._client = new watchman.Client();
client.on('end', () => this._onClientEnd());
Expand Down
4 changes: 4 additions & 0 deletions pkg/nuclide/server/spec/WatchmanClient-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ describe('WatchmanClient test suite', () => {
waits(1010);
});

afterEach(() => {
client.dispose();
});

describe('restore subscriptions', () => {
it('restores subscriptions on client end', () => {
waitsForPromise(async () => {
Expand Down

0 comments on commit dc7d1c5

Please sign in to comment.