Supporting patterns in classNames for Live Queries (#7131)

* Parse LiveQuery Server. Supporting patterns in classNames.

* Parse LiveQuery Server. Supporting patterns in classNames. Small optimisation.

* Parse LiveQuery Server. Supporting patterns in classNames. Adding info to changelog.

* Parse LiveQuery Server. Supporting patterns in classNames. Test case.
This commit is contained in:
Nikita
2021-01-20 01:19:11 +03:00
committed by GitHub
parent 034ea5c828
commit e592212b97
3 changed files with 33 additions and 2 deletions

View File

@@ -56,6 +56,29 @@ describe('ParseLiveQuery', function () {
await object.save();
});
it('can use patterns in className', async done => {
await reconfigureServer({
liveQuery: {
classNames: ['Test.*'],
},
startLiveQueryServer: true,
verbose: false,
silent: true,
});
const object = new TestObject();
await object.save();
const query = new Parse.Query(TestObject);
query.equalTo('objectId', object.id);
const subscription = await query.subscribe();
subscription.on('update', object => {
expect(object.get('foo')).toBe('bar');
done();
});
object.set({ foo: 'bar' });
await object.save();
});
it('expect afterEvent create', async done => {
await reconfigureServer({
liveQuery: {