Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/LiveQuerySubscription.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ class Subscription extends EventEmitter {
return CoreManager.getLiveQueryController().getDefaultLiveQueryClient().then((liveQueryClient) => {
liveQueryClient.unsubscribe(this);
this.emit('close');
this.resolve();
});
}
}
Expand Down
8 changes: 8 additions & 0 deletions src/__tests__/ParseLiveQuery-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jest.dontMock('../promiseUtils');
require('../ParseLiveQuery');
const CoreManager = require('../CoreManager');
const ParseQuery = require('../ParseQuery').default;
const LiveQuerySubscription = require('../LiveQuerySubscription').default;

describe('ParseLiveQuery', () => {
beforeEach(() => {
Expand Down Expand Up @@ -182,4 +183,11 @@ describe('ParseLiveQuery', () => {
});

});

it('should not throw on usubscribe', (done) => {
const query = new ParseQuery("ObjectType");
query.equalTo("test", "value");
const subscription = new LiveQuerySubscription('0', query, 'token');
subscription.unsubscribe().then(done).catch(done.fail);
});
});