@@ -140,7 +140,7 @@ export function createPaginationTestSuite(
140140 q
141141 . from ( { user : usersCollection } )
142142 . orderBy ( ( { user } ) => user . isActive , `desc` )
143- . orderBy ( ( { user } ) => user . age , `asc` )
143+ . orderBy ( ( { user } ) => user . age , `asc` ) ,
144144 )
145145
146146 await query . preload ( )
@@ -158,7 +158,7 @@ export function createPaginationTestSuite(
158158 if ( prev . isActive !== curr . isActive ) {
159159 // true (1) should come before false (0) in desc order
160160 expect ( prev . isActive ? 1 : 0 ) . toBeGreaterThanOrEqual (
161- curr . isActive ? 1 : 0
161+ curr . isActive ? 1 : 0 ,
162162 )
163163 } else {
164164 // If isActive is same, age should be ascending
@@ -181,7 +181,7 @@ export function createPaginationTestSuite(
181181 . from ( { user : usersCollection } )
182182 . orderBy ( ( { user } ) => user . isActive , `desc` )
183183 . orderBy ( ( { user } ) => user . age , `asc` )
184- . limit ( 10 )
184+ . limit ( 10 ) ,
185185 )
186186
187187 await query . preload ( )
@@ -197,7 +197,7 @@ export function createPaginationTestSuite(
197197
198198 if ( prev . isActive !== curr . isActive ) {
199199 expect ( prev . isActive ? 1 : 0 ) . toBeGreaterThanOrEqual (
200- curr . isActive ? 1 : 0
200+ curr . isActive ? 1 : 0 ,
201201 )
202202 } else {
203203 expect ( prev . age ) . toBeLessThanOrEqual ( curr . age )
@@ -217,7 +217,7 @@ export function createPaginationTestSuite(
217217 . from ( { user : usersCollection } )
218218 . orderBy ( ( { user } ) => user . isActive , `desc` )
219219 . orderBy ( ( { user } ) => user . age , `asc` )
220- . limit ( 15 )
220+ . limit ( 15 ) ,
221221 )
222222
223223 await query1 . preload ( )
@@ -232,7 +232,7 @@ export function createPaginationTestSuite(
232232 . from ( { user : usersCollection } )
233233 . orderBy ( ( { user } ) => user . isActive , `desc` )
234234 . orderBy ( ( { user } ) => user . age , `asc` )
235- . limit ( 30 )
235+ . limit ( 30 ) ,
236236 )
237237
238238 await query2 . preload ( )
@@ -253,7 +253,7 @@ export function createPaginationTestSuite(
253253
254254 if ( prev . isActive !== curr . isActive ) {
255255 expect ( prev . isActive ? 1 : 0 ) . toBeGreaterThanOrEqual (
256- curr . isActive ? 1 : 0
256+ curr . isActive ? 1 : 0 ,
257257 )
258258 } else {
259259 expect ( prev . age ) . toBeLessThanOrEqual ( curr . age )
@@ -275,7 +275,7 @@ export function createPaginationTestSuite(
275275 . from ( { user : usersCollection } )
276276 . orderBy ( ( { user } ) => user . isActive , `desc` )
277277 . orderBy ( ( { user } ) => user . age , `asc` )
278- . limit ( 50 )
278+ . limit ( 50 ) ,
279279 )
280280
281281 await query . preload ( )
@@ -297,7 +297,7 @@ export function createPaginationTestSuite(
297297 } else if ( foundInactive ) {
298298 // Found active after inactive - this is wrong
299299 throw new Error (
300- `Found active user after inactive user in desc order`
300+ `Found active user after inactive user in desc order` ,
301301 )
302302 }
303303 }
@@ -306,15 +306,15 @@ export function createPaginationTestSuite(
306306 if ( activeUsers . length > 1 ) {
307307 for ( let i = 1 ; i < activeUsers . length ; i ++ ) {
308308 expect ( activeUsers [ i - 1 ] ! . age ) . toBeLessThanOrEqual (
309- activeUsers [ i ] ! . age
309+ activeUsers [ i ] ! . age ,
310310 )
311311 }
312312 }
313313
314314 if ( inactiveUsers . length > 1 ) {
315315 for ( let i = 1 ; i < inactiveUsers . length ; i ++ ) {
316316 expect ( inactiveUsers [ i - 1 ] ! . age ) . toBeLessThanOrEqual (
317- inactiveUsers [ i ] ! . age
317+ inactiveUsers [ i ] ! . age ,
318318 )
319319 }
320320 }
@@ -332,7 +332,7 @@ export function createPaginationTestSuite(
332332 . from ( { post : postsCollection } )
333333 . orderBy ( ( { post } ) => post . userId , `asc` )
334334 . orderBy ( ( { post } ) => post . viewCount , `desc` )
335- . limit ( 20 )
335+ . limit ( 20 ) ,
336336 )
337337
338338 await query . preload ( )
@@ -355,7 +355,7 @@ export function createPaginationTestSuite(
355355 } else {
356356 // userId decreased - this is wrong
357357 throw new Error (
358- `userId should be ascending but ${ prev . userId } > ${ curr . userId } `
358+ `userId should be ascending but ${ prev . userId } > ${ curr . userId } ` ,
359359 )
360360 }
361361 }
@@ -374,7 +374,7 @@ export function createPaginationTestSuite(
374374 . orderBy ( ( { user } ) => user . isActive , `desc` )
375375 . orderBy ( ( { user } ) => user . age , `asc` )
376376 . orderBy ( ( { user } ) => user . name , `asc` )
377- . limit ( 25 )
377+ . limit ( 25 ) ,
378378 )
379379
380380 await query . preload ( )
@@ -390,7 +390,7 @@ export function createPaginationTestSuite(
390390
391391 if ( prev . isActive !== curr . isActive ) {
392392 expect ( prev . isActive ? 1 : 0 ) . toBeGreaterThanOrEqual (
393- curr . isActive ? 1 : 0
393+ curr . isActive ? 1 : 0 ,
394394 )
395395 } else if ( prev . age !== curr . age ) {
396396 expect ( prev . age ) . toBeLessThanOrEqual ( curr . age )
@@ -412,7 +412,7 @@ export function createPaginationTestSuite(
412412 . from ( { user : usersCollection } )
413413 . orderBy ( ( { user } ) => user . age , `asc` )
414414 . orderBy ( ( { user } ) => user . name , `asc` )
415- . limit ( 10 )
415+ . limit ( 10 ) ,
416416 )
417417
418418 await query . preload ( )
@@ -483,7 +483,7 @@ export function createPaginationTestSuite(
483483 . orderBy ( ( { user } ) => user . age , `asc` )
484484 . orderBy ( ( { user } ) => user . name , `asc` )
485485 . limit ( 10 )
486- . offset ( 20 )
486+ . offset ( 20 ) ,
487487 )
488488
489489 await query . preload ( )
@@ -533,7 +533,7 @@ export function createPaginationTestSuite(
533533 . from ( { post : postsCollection } )
534534 . orderBy ( ( { post } ) => post . userId , `asc` )
535535 . orderBy ( ( { post } ) => post . viewCount , `desc` )
536- . limit ( 10 )
536+ . limit ( 10 ) ,
537537 )
538538
539539 await query . preload ( )
@@ -565,7 +565,7 @@ export function createPaginationTestSuite(
565565 expect ( prev . viewCount ) . toBeGreaterThanOrEqual ( curr . viewCount )
566566 } else {
567567 throw new Error (
568- `userId should be ascending but ${ prev . userId } > ${ curr . userId } `
568+ `userId should be ascending but ${ prev . userId } > ${ curr . userId } ` ,
569569 )
570570 }
571571 }
@@ -584,7 +584,7 @@ export function createPaginationTestSuite(
584584 . from ( { user : usersCollection } )
585585 . orderBy ( ( { user } ) => user . age , `asc` )
586586 . orderBy ( ( { user } ) => user . name , `asc` )
587- . limit ( 20 )
587+ . limit ( 20 ) ,
588588 )
589589
590590 await query . preload ( )
@@ -654,7 +654,7 @@ export function createPaginationTestSuite(
654654 . from ( { user : usersCollection } )
655655 . orderBy ( ( { user } ) => user . age , `asc` )
656656 . orderBy ( ( { user } ) => user . name , `asc` )
657- . limit ( 5 )
657+ . limit ( 5 ) ,
658658 )
659659
660660 await query . preload ( )
@@ -673,7 +673,7 @@ export function createPaginationTestSuite(
673673 // when we need to load data we don't have yet. This proves loading was triggered.
674674 // If it returned `true`, it would mean data was already available (no loading needed).
675675 expect (
676- setWindowResult === true || setWindowResult instanceof Promise
676+ setWindowResult === true || setWindowResult instanceof Promise ,
677677 ) . toBe ( true )
678678
679679 if ( setWindowResult !== true ) {
@@ -700,12 +700,12 @@ export function createPaginationTestSuite(
700700 if ( lastItemFirstPage . age === firstItemSecondPage . age ) {
701701 // Same age value, so name should be greater or equal
702702 expect (
703- firstItemSecondPage . name . localeCompare ( lastItemFirstPage . name )
703+ firstItemSecondPage . name . localeCompare ( lastItemFirstPage . name ) ,
704704 ) . toBeGreaterThanOrEqual ( 0 )
705705 } else {
706706 // Different age, page 2 first should have greater or equal age
707707 expect ( firstItemSecondPage . age ) . toBeGreaterThanOrEqual (
708- lastItemFirstPage . age
708+ lastItemFirstPage . age ,
709709 )
710710 }
711711
0 commit comments