Skip to content

Commit 1772e79

Browse files
committed
Parse LiveQuery Server. Supporting patterns in classNames. Test case.
1 parent d419e85 commit 1772e79

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

spec/ParseLiveQuery.spec.js

+23
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,29 @@ describe('ParseLiveQuery', function () {
5656
await object.save();
5757
});
5858

59+
it('can use patterns in className', async done => {
60+
await reconfigureServer({
61+
liveQuery: {
62+
classNames: ['Test.*'],
63+
},
64+
startLiveQueryServer: true,
65+
verbose: false,
66+
silent: true,
67+
});
68+
const object = new TestObject();
69+
await object.save();
70+
71+
const query = new Parse.Query(TestObject);
72+
query.equalTo('objectId', object.id);
73+
const subscription = await query.subscribe();
74+
subscription.on('update', object => {
75+
expect(object.get('foo')).toBe('bar');
76+
done();
77+
});
78+
object.set({ foo: 'bar' });
79+
await object.save();
80+
});
81+
5982
it('expect afterEvent create', async done => {
6083
await reconfigureServer({
6184
liveQuery: {

0 commit comments

Comments
 (0)