@@ -12,7 +12,7 @@ const index = {
1212 uid : 'movies_test' ,
1313}
1414
15- const DEFAULT_SEARCHCUTOFFMS = 1500
15+ const DEFAULT_SEARCHCUTOFFMS = null
1616
1717jest . setTimeout ( 100 * 1000 )
1818
@@ -34,14 +34,12 @@ describe.each([{ permission: 'Master' }, { permission: 'Admin' }])(
3434 const client = await getClient ( permission )
3535 const response = await client . index ( index . uid ) . getSearchCutoffMs ( )
3636
37- expect ( response ) . toEqual ( { searchCutoffMs : DEFAULT_SEARCHCUTOFFMS } )
37+ expect ( response ) . toEqual ( DEFAULT_SEARCHCUTOFFMS )
3838 } )
3939
4040 test ( `${ permission } key: Update searchCutoffMs to valid value` , async ( ) => {
4141 const client = await getClient ( permission )
42- const newSearchCutoffMs = {
43- searchCutoffMs : 100 ,
44- }
42+ const newSearchCutoffMs = 100
4543 const task = await client
4644 . index ( index . uid )
4745 . updateSearchCutoffMs ( newSearchCutoffMs )
@@ -54,24 +52,20 @@ describe.each([{ permission: 'Master' }, { permission: 'Admin' }])(
5452
5553 test ( `${ permission } key: Update searchCutoffMs to null` , async ( ) => {
5654 const client = await getClient ( permission )
57- const newSearchCutoffMs = {
58- searchCutoffMs : null ,
59- }
55+ const newSearchCutoffMs = null
6056 const task = await client
6157 . index ( index . uid )
6258 . updateSearchCutoffMs ( newSearchCutoffMs )
6359 await client . index ( index . uid ) . waitForTask ( task . taskUid )
6460
6561 const response = await client . index ( index . uid ) . getSearchCutoffMs ( )
6662
67- expect ( response ) . toEqual ( { searchCutoffMs : DEFAULT_SEARCHCUTOFFMS } )
63+ expect ( response ) . toEqual ( DEFAULT_SEARCHCUTOFFMS )
6864 } )
6965
7066 test ( `${ permission } key: Update searchCutoffMs with invalid value` , async ( ) => {
7167 const client = await getClient ( permission )
72- const newSearchCutoffMs = {
73- searchCutoffMs : 'hello' , // bad searchCutoffMs value
74- } as any
68+ const newSearchCutoffMs = 'hello' as any // bad searchCutoffMs value
7569
7670 await expect (
7771 client . index ( index . uid ) . updateSearchCutoffMs ( newSearchCutoffMs )
@@ -83,9 +77,7 @@ describe.each([{ permission: 'Master' }, { permission: 'Admin' }])(
8377
8478 test ( `${ permission } key: Reset searchCutoffMs` , async ( ) => {
8579 const client = await getClient ( permission )
86- const newSearchCutoffMs = {
87- searchCutoffMs : 100 ,
88- }
80+ const newSearchCutoffMs = 100
8981 const updateTask = await client
9082 . index ( index . uid )
9183 . updateSearchCutoffMs ( newSearchCutoffMs )
@@ -95,7 +87,7 @@ describe.each([{ permission: 'Master' }, { permission: 'Admin' }])(
9587
9688 const response = await client . index ( index . uid ) . getSearchCutoffMs ( )
9789
98- expect ( response ) . toEqual ( { searchCutoffMs : DEFAULT_SEARCHCUTOFFMS } )
90+ expect ( response ) . toEqual ( DEFAULT_SEARCHCUTOFFMS )
9991 } )
10092 }
10193)
@@ -119,7 +111,7 @@ describe.each([{ permission: 'Search' }])(
119111 test ( `${ permission } key: try to update searchCutoffMs and be denied` , async ( ) => {
120112 const client = await getClient ( permission )
121113 await expect (
122- client . index ( index . uid ) . updateSearchCutoffMs ( { searchCutoffMs : 100 } )
114+ client . index ( index . uid ) . updateSearchCutoffMs ( 100 )
123115 ) . rejects . toHaveProperty ( 'code' , ErrorStatusCode . INVALID_API_KEY )
124116 } )
125117
@@ -154,7 +146,7 @@ describe.each([{ permission: 'No' }])(
154146 test ( `${ permission } key: try to update searchCutoffMs and be denied` , async ( ) => {
155147 const client = await getClient ( permission )
156148 await expect (
157- client . index ( index . uid ) . updateSearchCutoffMs ( { searchCutoffMs : 100 } )
149+ client . index ( index . uid ) . updateSearchCutoffMs ( 100 )
158150 ) . rejects . toHaveProperty (
159151 'code' ,
160152 ErrorStatusCode . MISSING_AUTHORIZATION_HEADER
@@ -198,7 +190,7 @@ describe.each([
198190 const client = new MeiliSearch ( { host } )
199191 const strippedHost = trailing ? host . slice ( 0 , - 1 ) : host
200192 await expect (
201- client . index ( index . uid ) . updateSearchCutoffMs ( { searchCutoffMs : null } )
193+ client . index ( index . uid ) . updateSearchCutoffMs ( null )
202194 ) . rejects . toHaveProperty (
203195 'message' ,
204196 `request to ${ strippedHost } /${ route } failed, reason: connect ECONNREFUSED ${ BAD_HOST . replace (
0 commit comments