@@ -19,7 +19,7 @@ describe('Query parameter array limit', () => {
1919 if ( app ) await app . stop ( ) ;
2020 } ) ;
2121
22- context ( 'with default arrayLimit (100 )' , ( ) => {
22+ context ( 'with default arrayLimit (30 )' , ( ) => {
2323 beforeEach ( async ( ) => {
2424 app = givenApplication ( ) ;
2525 await app . start ( ) ;
@@ -34,26 +34,17 @@ describe('Query parameter array limit', () => {
3434 expect ( response . body . ids ) . to . eql ( ids ) ;
3535 } ) ;
3636
37- it ( 'parses arrays with 21 items correctly' , async ( ) => {
38- const ids = Array . from ( { length : 21 } , ( _ , i ) => ( i + 1 ) . toString ( ) ) ;
39- const query = ids . map ( id => `ids=${ id } ` ) . join ( '&' ) ;
40-
41- const response = await client . get ( `/test?${ query } ` ) . expect ( 200 ) ;
42- expect ( response . body . ids ) . to . eql ( ids ) ;
43- expect ( Array . isArray ( response . body . ids ) ) . to . be . true ( ) ;
44- } ) ;
45-
46- it ( 'parses arrays with 100 items correctly' , async ( ) => {
47- const ids = Array . from ( { length : 100 } , ( _ , i ) => ( i + 1 ) . toString ( ) ) ;
37+ it ( 'parses arrays with 30 items correctly' , async ( ) => {
38+ const ids = Array . from ( { length : 30 } , ( _ , i ) => ( i + 1 ) . toString ( ) ) ;
4839 const query = ids . map ( id => `ids=${ id } ` ) . join ( '&' ) ;
4940
5041 const response = await client . get ( `/test?${ query } ` ) . expect ( 200 ) ;
5142 expect ( response . body . ids ) . to . eql ( ids ) ;
5243 expect ( Array . isArray ( response . body . ids ) ) . to . be . true ( ) ;
5344 } ) ;
5445
55- it ( 'converts arrays with 101 + items to objects (exceeds default limit)' , async ( ) => {
56- const ids = Array . from ( { length : 101 } , ( _ , i ) => ( i + 1 ) . toString ( ) ) ;
46+ it ( 'converts arrays with 31 + items to objects (exceeds default limit)' , async ( ) => {
47+ const ids = Array . from ( { length : 31 } , ( _ , i ) => ( i + 1 ) . toString ( ) ) ;
5748 const query = ids . map ( id => `ids=${ id } ` ) . join ( '&' ) ;
5849
5950 await client . get ( `/test?${ query } ` ) . expect ( 400 ) ;
0 commit comments