@@ -42,7 +42,7 @@ describe('queryFilter()', function () {
4242
4343        context ( 'when query contains pagination param with string limit as skip' ,  function  ( )  { 
4444            it ( 'should return req.query with set pagination params' ,  function  ( )  { 
45-                 const  expect_pagination  =  { limit : Number . MAX_SAFE_INTEGER ,  skip : 2 } 
45+                 const  expect_pagination  =  {   limit : Number . MAX_SAFE_INTEGER ,  skip : 2   } 
4646
4747                const  options  =  JSON . parse ( JSON . stringify ( default_options ) ) 
4848                options . default . pagination . limit  =  expect_pagination . limit 
@@ -60,7 +60,7 @@ describe('queryFilter()', function () {
6060
6161        context ( 'when query contains pagination param with string skip' ,  function  ( )  { 
6262            it ( 'should return req.query with set pagination params' ,  function  ( )  { 
63-                 const  expect_pagination  =  { limit : 10 ,  skip : 0 } 
63+                 const  expect_pagination  =  {   limit : 10 ,  skip : 0   } 
6464
6565                const  options  =  JSON . parse ( JSON . stringify ( default_options ) ) 
6666                options . default . pagination . limit  =  expect_pagination . limit 
@@ -78,7 +78,7 @@ describe('queryFilter()', function () {
7878
7979        context ( 'when query contains ordination param' ,  function  ( )  { 
8080            it ( 'should return req.query with set ordination params' ,  function  ( )  { 
81-                 const  expect_sort  =  { name : 1 ,  age : - 1 } 
81+                 const  expect_sort  =  {   name : 1 ,  age : - 1   } 
8282
8383                const  options  =  JSON . parse ( JSON . stringify ( default_options ) ) 
8484                options . default . sort  =  expect_sort 
@@ -95,7 +95,7 @@ describe('queryFilter()', function () {
9595
9696        context ( 'when query contains fields param' ,  function  ( )  { 
9797            it ( 'should return req.query with set field params' ,  function  ( )  { 
98-                 const  expect_fields  =  { name : 1 ,  age : 1 } 
98+                 const  expect_fields  =  {   name : 1 ,  age : 1   } 
9999
100100                const  options  =  JSON . parse ( JSON . stringify ( default_options ) ) 
101101                options . default . fields  =  expect_fields 
@@ -112,7 +112,7 @@ describe('queryFilter()', function () {
112112
113113        context ( 'when query contains simple filters param' ,  function  ( )  { 
114114            it ( 'should return req.query with set field params' ,  function  ( )  { 
115-                 const  expect_filters  =  { name : 'lucas' ,  age : 30 } 
115+                 const  expect_filters  =  {   name : 'lucas' ,  age : 30   } 
116116
117117                const  options  =  JSON . parse ( JSON . stringify ( default_options ) ) 
118118                options . default . filters  =  expect_filters 
@@ -138,17 +138,17 @@ describe('queryFilter()', function () {
138138                            name : {  '$options' : 'i' ,  '$regex' : 'd[o,ó,ö,ò,ô][u,ü,ú,ù]gl[a,á,à,ä,â,ã]s$'  } 
139139                        } , 
140140                        { 
141-                             name : {  '$options' : 'i' ,  '$regex' : 'j[o,ó,ö,ò,ô]rg[e,é,ë,ê ]'  } 
141+                             name : {  '$options' : 'i' ,  '$regex' : 'J[O,Ó,Ö,Ò,Ô]RG[E,É,Ë,Ê ]'  } 
142142                        } ] , 
143143                    'school.name' : 'UEPB' , 
144144                    'timestamp' : '2018-12-05T00:00:00' , 
145-                     '$or' : [ { job : 'Developer' } ,  { job : 'Engineer' } ] 
145+                     '$or' : [ {   job : 'Developer'   } ,  {   job : 'Engineer'   } ] 
146146                } 
147147
148148                const  options  =  JSON . parse ( JSON . stringify ( default_options ) ) 
149149                options . default . filters  =  expect_filters 
150150
151-                 const  query  =  '?name=lucas****&name=*****douglas&name=*****jorge *****&.school.name.=UEPB' 
151+                 const  query  =  '?name=lucas****&name=*****douglas&name=*****JORGE *****&.school.name.=UEPB' 
152152                    . concat ( '×tamp=2018-12-05&job=Developer,Engineer' ) 
153153
154154                return  request ( app ) 
@@ -163,9 +163,9 @@ describe('queryFilter()', function () {
163163            it ( 'should return req.query with set field params' ,  function  ( )  { 
164164                const  expect_filters  =  { 
165165                    name : 'lucas' , 
166-                     age : { $gt : 30 } , 
167-                     timestamp : { $gt : '2018-12-05T00:00:00' } , 
168-                     created_at : { $lte : '2018-12-06T00:00:00' } , 
166+                     age : {   $gt : 30   } , 
167+                     timestamp : {   $gt : '2018-12-05T00:00:00'   } , 
168+                     created_at : {   $lte : '2018-12-06T00:00:00'   } , 
169169                    sleep_hour : '22:40' 
170170                } 
171171
@@ -185,10 +185,10 @@ describe('queryFilter()', function () {
185185            it ( 'should return req.query with set field params (with $ne filter)' ,  function  ( )  { 
186186                const  expect_filters  =  { 
187187                    name : 'lucas' , 
188-                     age : { $gt : 30 } , 
189-                     type : { $ne : 'admin' } , 
190-                     timestamp : { $gt : '2018-12-05T00:00:00' } , 
191-                     created_at : { $lte : '2018-12-06T00:00:00' } , 
188+                     age : {   $gt : 30   } , 
189+                     type : {   $ne : 'admin'   } , 
190+                     timestamp : {   $gt : '2018-12-05T00:00:00'   } , 
191+                     created_at : {   $lte : '2018-12-06T00:00:00'   } , 
192192                    sleep_hour : '22:40' 
193193                } 
194194
@@ -210,8 +210,8 @@ describe('queryFilter()', function () {
210210            it ( 'should return req.query with set start_at params as today' ,  function  ( )  { 
211211                const  expect_filters  =  { 
212212                    $and : [ 
213-                         { created_at : { $lt : normalizeDate ( dateToString ( new  Date ( ) ) ,  false ) } } , 
214-                         { created_at : { $gte : normalizeDate ( dateToString ( new  Date ( ) ) ,  true ) } } 
213+                         {   created_at : {   $lt : normalizeDate ( dateToString ( new  Date ( ) ) ,  false )   }   } , 
214+                         {   created_at : {   $gte : normalizeDate ( dateToString ( new  Date ( ) ) ,  true )   }   } 
215215                    ] 
216216                } 
217217
@@ -230,8 +230,8 @@ describe('queryFilter()', function () {
230230            it ( 'should return req.query with set end_at params as today' ,  function  ( )  { 
231231                const  expect_filters  =  { 
232232                    $and : [ 
233-                         { created_at : { $lt : normalizeDate ( dateToString ( new  Date ( ) ) ,  false ) } } , 
234-                         { created_at : { $gte : '2019-02-05T00:00:00' } } 
233+                         {   created_at : {   $lt : normalizeDate ( dateToString ( new  Date ( ) ) ,  false )   }   } , 
234+                         {   created_at : {   $gte : '2019-02-05T00:00:00'   }   } 
235235                    ] 
236236                } 
237237
@@ -250,8 +250,8 @@ describe('queryFilter()', function () {
250250            it ( 'should return req.query with set start_at params as date' ,  function  ( )  { 
251251                const  expect_filters  =  { 
252252                    $and : [ 
253-                         { created_at : { $lt : normalizeDate ( dateToString ( new  Date ( ) ) ,  false ) } } , 
254-                         { created_at : { $gte : '2018-12-05T00:00:01' } } 
253+                         {   created_at : {   $lt : normalizeDate ( dateToString ( new  Date ( ) ) ,  false )   }   } , 
254+                         {   created_at : {   $gte : '2018-12-05T00:00:01'   }   } 
255255                    ] 
256256                } 
257257
@@ -271,8 +271,8 @@ describe('queryFilter()', function () {
271271            it ( 'should return req.query with set start_at params as dateTime' ,  function  ( )  { 
272272                const  expect_filters  =  { 
273273                    $and : [ 
274-                         { created_at : { $lt : normalizeDate ( dateToString ( new  Date ( ) ) ,  false ) } } , 
275-                         { created_at : { $gte : '2018-12-05T00:00:00' } } 
274+                         {   created_at : {   $lt : normalizeDate ( dateToString ( new  Date ( ) ) ,  false )   }   } , 
275+                         {   created_at : {   $gte : '2018-12-05T00:00:00'   }   } 
276276                    ] 
277277                } 
278278
@@ -292,8 +292,8 @@ describe('queryFilter()', function () {
292292
293293                const  expect_filters  =  { 
294294                    $and : [ 
295-                         { created_at : { $lt : '2018-12-11T00:00:00' } } , 
296-                         { created_at : { $gte : '2018-12-01T00:00:00' } } ] 
295+                         {   created_at : {   $lt : '2018-12-11T00:00:00'   }   } , 
296+                         {   created_at : {   $gte : '2018-12-01T00:00:00'   }   } ] 
297297                } 
298298
299299
@@ -313,8 +313,8 @@ describe('queryFilter()', function () {
313313
314314                const  expect_filters  =  { 
315315                    $and : [ 
316-                         { created_at : { $lt : '2018-12-11T03:02:01' } } , 
317-                         { created_at : { $gte : '2018-12-01T01:02:03' } } ] 
316+                         {   created_at : {   $lt : '2018-12-11T03:02:01'   }   } , 
317+                         {   created_at : {   $gte : '2018-12-01T01:02:03'   }   } ] 
318318                } 
319319
320320                const  options  =  JSON . parse ( JSON . stringify ( default_options ) ) 
@@ -332,8 +332,8 @@ describe('queryFilter()', function () {
332332            it ( 'should return req.query with period as day and start_at param' ,  function  ( )  { 
333333                const  expect_filters  =  { 
334334                    $and : [ 
335-                         { created_at : { $lt : '2019-01-26T23:59:59' } } , 
336-                         { created_at : { $gte : '2019-01-24T00:00:00' } } 
335+                         {   created_at : {   $lt : '2019-01-26T23:59:59'   }   } , 
336+                         {   created_at : {   $gte : '2019-01-24T00:00:00'   }   } 
337337                    ] 
338338                } 
339339
@@ -352,8 +352,8 @@ describe('queryFilter()', function () {
352352            it ( 'should return req.query with period as day and end_at param' ,  function  ( )  { 
353353                const  expect_filters  =  { 
354354                    $and : [ 
355-                         { created_at : { $lt : '2019-01-26T00:00:00' } } , 
356-                         { created_at : { $gte : '2019-01-24T00:00:00' } } 
355+                         {   created_at : {   $lt : '2019-01-26T00:00:00'   }   } , 
356+                         {   created_at : {   $gte : '2019-01-24T00:00:00'   }   } 
357357                    ] 
358358                } 
359359
@@ -372,8 +372,8 @@ describe('queryFilter()', function () {
372372            it ( 'should return req.query with period as week and start_at param' ,  function  ( )  { 
373373                const  expect_filters  =  { 
374374                    $and : [ 
375-                         { created_at : { $lt : '2019-01-26T23:59:59' } } , 
376-                         { created_at : { $gte : '2019-01-19T00:00:00' } } 
375+                         {   created_at : {   $lt : '2019-01-26T23:59:59'   }   } , 
376+                         {   created_at : {   $gte : '2019-01-19T00:00:00'   }   } 
377377                    ] 
378378                } 
379379
@@ -392,8 +392,8 @@ describe('queryFilter()', function () {
392392            it ( 'should return req.query with period as week and end_at param' ,  function  ( )  { 
393393                const  expect_filters  =  { 
394394                    $and : [ 
395-                         { created_at : { $lt : '2019-01-26T23:59:59' } } , 
396-                         { created_at : { $gte : '2019-01-19T00:00:00' } } 
395+                         {   created_at : {   $lt : '2019-01-26T23:59:59'   }   } , 
396+                         {   created_at : {   $gte : '2019-01-19T00:00:00'   }   } 
397397                    ] 
398398                } 
399399
@@ -412,8 +412,8 @@ describe('queryFilter()', function () {
412412            it ( 'should return req.query with period as month and start_at param' ,  function  ( )  { 
413413                const  expect_filters  =  { 
414414                    $and : [ 
415-                         { created_at : { $lt : '2019-02-24T23:59:59' } } , 
416-                         { created_at : { $gte : '2019-01-24T00:00:00' } } 
415+                         {   created_at : {   $lt : '2019-02-24T23:59:59'   }   } , 
416+                         {   created_at : {   $gte : '2019-01-24T00:00:00'   }   } 
417417                    ] 
418418                } 
419419
@@ -432,8 +432,8 @@ describe('queryFilter()', function () {
432432            it ( 'should return req.query with period as month and end_at param' ,  function  ( )  { 
433433                const  expect_filters  =  { 
434434                    $and : [ 
435-                         { created_at : { $lt : '2019-01-24T23:59:59' } } , 
436-                         { created_at : { $gte : '2018-12-24T00:00:00' } } 
435+                         {   created_at : {   $lt : '2019-01-24T23:59:59'   }   } , 
436+                         {   created_at : {   $gte : '2018-12-24T00:00:00'   }   } 
437437                    ] 
438438                } 
439439
@@ -452,8 +452,8 @@ describe('queryFilter()', function () {
452452            it ( 'should return req.query with period as year and start_at param' ,  function  ( )  { 
453453                const  expect_filters  =  { 
454454                    $and : [ 
455-                         { created_at : { $lt : '2019-02-24T23:59:59' } } , 
456-                         { created_at : { $gte : '2018-02-24T00:00:00' } } 
455+                         {   created_at : {   $lt : '2019-02-24T23:59:59'   }   } , 
456+                         {   created_at : {   $gte : '2018-02-24T00:00:00'   }   } 
457457                    ] 
458458                } 
459459
@@ -472,8 +472,8 @@ describe('queryFilter()', function () {
472472            it ( 'should return req.query with period as year and end_at param' ,  function  ( )  { 
473473                const  expect_filters  =  { 
474474                    $and : [ 
475-                         { created_at : { $lt : '2019-02-24T23:59:59' } } , 
476-                         { created_at : { $gte : '2018-02-24T00:00:00' } } 
475+                         {   created_at : {   $lt : '2019-02-24T23:59:59'   }   } , 
476+                         {   created_at : {   $gte : '2018-02-24T00:00:00'   }   } 
477477                    ] 
478478                } 
479479
@@ -492,8 +492,8 @@ describe('queryFilter()', function () {
492492            it ( 'should return req.query with today start_at for invalid period' ,  function  ( )  { 
493493                const  expect_filters  =  { 
494494                    $and : [ 
495-                         { created_at : { $lt : normalizeDate ( dateToString ( new  Date ( ) ) ,  false ) } } , 
496-                         { created_at : { $gte : normalizeDate ( dateToString ( new  Date ( ) ) ,  true ) } } 
495+                         {   created_at : {   $lt : normalizeDate ( dateToString ( new  Date ( ) ) ,  false )   }   } , 
496+                         {   created_at : {   $gte : normalizeDate ( dateToString ( new  Date ( ) ) ,  true )   }   } 
497497                    ] 
498498                } 
499499
@@ -512,8 +512,8 @@ describe('queryFilter()', function () {
512512            it ( 'should return req.query with today end_at for invalid period' ,  function  ( )  { 
513513                const  expect_filters  =  { 
514514                    $and : [ 
515-                         { created_at : { $lt : normalizeDate ( dateToString ( new  Date ( ) ) ,  false ) } } , 
516-                         { created_at : { $gte : '2018-12-05T00:00:01' } } 
515+                         {   created_at : {   $lt : normalizeDate ( dateToString ( new  Date ( ) ) ,  false )   }   } , 
516+                         {   created_at : {   $gte : '2018-12-05T00:00:01'   }   } 
517517                    ] 
518518                } 
519519
0 commit comments