@@ -4,6 +4,7 @@ const Parse = require('parse/node');
4
4
5
5
describe ( 'ParseLiveQuery query operation' , function ( ) {
6
6
beforeEach ( function ( done ) {
7
+ Parse . CoreManager . getLiveQueryController ( ) . setDefaultLiveQueryClient ( null ) ;
7
8
// Mock ParseWebSocketServer
8
9
const mockParseWebSocketServer = jasmine . createSpy ( 'ParseWebSocketServer' ) ;
9
10
jasmine . mockLibrary (
@@ -17,7 +18,11 @@ describe('ParseLiveQuery query operation', function () {
17
18
done ( ) ;
18
19
} ) ;
19
20
20
- afterEach ( function ( ) {
21
+ afterEach ( async function ( ) {
22
+ const client = await Parse . CoreManager . getLiveQueryController ( ) . getDefaultLiveQueryClient ( ) ;
23
+ if ( client ) {
24
+ await client . close ( ) ;
25
+ }
21
26
jasmine . restoreLibrary ( '../lib/LiveQuery/ParseWebSocketServer' , 'ParseWebSocketServer' ) ;
22
27
} ) ;
23
28
@@ -59,7 +64,14 @@ describe('ParseLiveQuery query operation', function () {
59
64
}
60
65
61
66
it ( 'can handle query command with existing subscription' , async ( ) => {
62
- await reconfigureServer ( ) ;
67
+ await reconfigureServer ( {
68
+ liveQuery : {
69
+ classNames : [ 'TestObject' ] ,
70
+ } ,
71
+ startLiveQueryServer : true ,
72
+ verbose : false ,
73
+ silent : true ,
74
+ } ) ;
63
75
64
76
const { ParseLiveQueryServer } = require ( '../lib/LiveQuery/ParseLiveQueryServer' ) ;
65
77
const parseLiveQueryServer = new ParseLiveQueryServer ( {
@@ -138,7 +150,14 @@ describe('ParseLiveQuery query operation', function () {
138
150
} ) ;
139
151
140
152
it ( 'respects field filtering (keys) when executing query' , async ( ) => {
141
- await reconfigureServer ( ) ;
153
+ await reconfigureServer ( {
154
+ liveQuery : {
155
+ classNames : [ 'TestObject' ] ,
156
+ } ,
157
+ startLiveQueryServer : true ,
158
+ verbose : false ,
159
+ silent : true ,
160
+ } ) ;
142
161
143
162
const { ParseLiveQueryServer } = require ( '../lib/LiveQuery/ParseLiveQueryServer' ) ;
144
163
const parseLiveQueryServer = new ParseLiveQueryServer ( {
@@ -192,7 +211,14 @@ describe('ParseLiveQuery query operation', function () {
192
211
} ) ;
193
212
194
213
it ( 'handles query with where constraints' , async ( ) => {
195
- await reconfigureServer ( ) ;
214
+ await reconfigureServer ( {
215
+ liveQuery : {
216
+ classNames : [ 'TestObject' ] ,
217
+ } ,
218
+ startLiveQueryServer : true ,
219
+ verbose : false ,
220
+ silent : true ,
221
+ } ) ;
196
222
197
223
const { ParseLiveQueryServer } = require ( '../lib/LiveQuery/ParseLiveQueryServer' ) ;
198
224
const parseLiveQueryServer = new ParseLiveQueryServer ( {
0 commit comments