@@ -275,32 +275,26 @@ describe('Parse.Query testing', () => {
275275 } ) ;
276276 } ) ;
277277
278- it ( 'query with limit equal to maxlimit' , function ( done ) {
278+ it ( 'query with limit equal to maxlimit' , async ( ) => {
279279 const baz = new TestObject ( { foo : 'baz' } ) ;
280280 const qux = new TestObject ( { foo : 'qux' } ) ;
281- reconfigureServer ( { maxLimit : 1 } ) ;
282- Parse . Object . saveAll ( [ baz , qux ] ) . then ( function ( ) {
283- const query = new Parse . Query ( TestObject ) ;
284- query . limit ( 1 ) ;
285- query . find ( ) . then ( function ( results ) {
286- equal ( results . length , 1 ) ;
287- done ( ) ;
288- } ) ;
289- } ) ;
281+ await reconfigureServer ( { maxLimit : 1 } ) ;
282+ await Parse . Object . saveAll ( [ baz , qux ] ) ;
283+ const query = new Parse . Query ( TestObject ) ;
284+ query . limit ( 1 ) ;
285+ const results = await query . find ( ) ;
286+ equal ( results . length , 1 ) ;
290287 } ) ;
291288
292- it ( 'query with limit exceeding maxlimit' , function ( done ) {
289+ it ( 'query with limit exceeding maxlimit' , async ( ) => {
293290 const baz = new TestObject ( { foo : 'baz' } ) ;
294291 const qux = new TestObject ( { foo : 'qux' } ) ;
295- reconfigureServer ( { maxLimit : 1 } ) ;
296- Parse . Object . saveAll ( [ baz , qux ] ) . then ( function ( ) {
297- const query = new Parse . Query ( TestObject ) ;
298- query . limit ( 2 ) ;
299- query . find ( ) . then ( function ( results ) {
300- equal ( results . length , 1 ) ;
301- done ( ) ;
302- } ) ;
303- } ) ;
292+ await reconfigureServer ( { maxLimit : 1 } ) ;
293+ await Parse . Object . saveAll ( [ baz , qux ] ) ;
294+ const query = new Parse . Query ( TestObject ) ;
295+ query . limit ( 2 ) ;
296+ const results = await query . find ( ) ;
297+ equal ( results . length , 1 ) ;
304298 } ) ;
305299
306300 it ( 'containedIn object array queries' , function ( done ) {
0 commit comments