@@ -20,13 +20,7 @@ describe('collections', () => {
2020 await new Promise ( ( res , rej ) => {
2121 resolve = jest . fn ( res )
2222 reject = jest . fn ( rej )
23- unbind = bindCollection ( {
24- target,
25- collection,
26- resolve,
27- reject,
28- ops,
29- } )
23+ unbind = bindCollection ( target , collection , ops , resolve , reject )
3024 } )
3125 } )
3226
@@ -122,13 +116,7 @@ describe('collections', () => {
122116 throw new Error ( 'Promise was not called' )
123117 }
124118 await new Promise ( ( resolve , reject ) => {
125- unbind = bindCollection ( {
126- target,
127- collection,
128- resolve,
129- reject,
130- ops,
131- } )
119+ unbind = bindCollection ( target , collection , ops , resolve , reject )
132120 } )
133121
134122 expect ( unbindSpy ) . not . toHaveBeenCalled ( )
@@ -154,7 +142,7 @@ describe('collections', () => {
154142 collection . onSnapshot = jest . fn ( fakeOnSnapshot )
155143 await expect (
156144 new Promise ( ( resolve , reject ) => {
157- bindCollection ( { target, collection, resolve , reject , ops } )
145+ bindCollection ( target , collection , ops , resolve , reject )
158146 } )
159147 ) . rejects . toThrow ( )
160148 // @ts -ignore
@@ -165,13 +153,7 @@ describe('collections', () => {
165153 await collection . add ( { foo : 'foo' } )
166154 await collection . add ( { foo : 'foo' } )
167155 const promise = new Promise ( ( resolve , reject ) => {
168- bindCollection ( {
169- target,
170- collection,
171- resolve,
172- reject,
173- ops,
174- } )
156+ bindCollection ( target , collection , ops , resolve , reject )
175157 } )
176158 await promise
177159 expect ( target . value ) . toEqual ( [ { foo : 'foo' } , { foo : 'foo' } ] )
@@ -183,13 +165,7 @@ describe('collections', () => {
183165 throw new Error ( 'Promise was not called' )
184166 }
185167 const promise = new Promise ( ( resolve , reject ) => {
186- unbind = bindCollection ( {
187- target,
188- collection,
189- resolve,
190- reject,
191- ops,
192- } )
168+ unbind = bindCollection ( target , collection , ops , resolve , reject )
193169 } )
194170 await promise
195171 expect ( target . value ) . toEqual ( [ { foo : 'foo' } ] )
@@ -203,13 +179,7 @@ describe('collections', () => {
203179 throw new Error ( 'Promise was not called' )
204180 }
205181 const promise = new Promise ( ( resolve , reject ) => {
206- unbind = bindCollection ( {
207- target,
208- collection,
209- resolve,
210- reject,
211- ops,
212- } )
182+ unbind = bindCollection ( target , collection , ops , resolve , reject )
213183 } )
214184 await promise
215185 expect ( target . value ) . toEqual ( [ { foo : 'foo' } ] )
@@ -223,13 +193,7 @@ describe('collections', () => {
223193 throw new Error ( 'Promise was not called' )
224194 }
225195 const promise = new Promise ( ( resolve , reject ) => {
226- unbind = bindCollection ( {
227- target,
228- collection,
229- resolve,
230- reject,
231- ops,
232- } )
196+ unbind = bindCollection ( target , collection , ops , resolve , reject )
233197 } )
234198 await promise
235199 expect ( target . value ) . toEqual ( [ { foo : 'foo' } ] )
@@ -244,10 +208,9 @@ describe('collections', () => {
244208 await other . add ( { b : 1 } )
245209
246210 await new Promise ( ( resolve , reject ) => {
247- unbind = bindCollection (
248- { target, collection : other , resolve, reject, ops } ,
249- { reset : false }
250- )
211+ unbind = bindCollection ( target , other , ops , resolve , reject , {
212+ reset : false ,
213+ } )
251214 } )
252215 expect ( target . value ) . toEqual ( [ { a : 0 } , { b : 1 } ] )
253216 unbind ( )
@@ -265,10 +228,7 @@ describe('collections', () => {
265228 // force the unbind without resetting the value
266229 unbind ( false )
267230 const promise = new Promise ( ( resolve , reject ) => {
268- bindCollection (
269- { target, collection : other , resolve, reject, ops } ,
270- { wait : true }
271- )
231+ bindCollection ( target , other , ops , resolve , reject , { wait : true } )
272232 } )
273233 expect ( target . value ) . toEqual ( [ { foo : 'foo' } , { foo : 'foo' } ] )
274234 await promise
@@ -283,16 +243,9 @@ describe('collections', () => {
283243 // @ts -ignore
284244 target . value = 'foo'
285245 await new Promise ( ( resolve , reject ) => {
286- bindCollection (
287- {
288- target,
289- collection : db . collection ( ) as any ,
290- resolve,
291- reject,
292- ops,
293- } ,
294- { wait : true }
295- )
246+ bindCollection ( target , db . collection ( ) as any , ops , resolve , reject , {
247+ wait : true ,
248+ } )
296249 } )
297250 expect ( target . value ) . toEqual ( [ ] )
298251 } )
@@ -309,10 +262,7 @@ describe('collections', () => {
309262 // force the unbind without resetting the value
310263 unbind ( false )
311264 const promise = new Promise ( ( resolve , reject ) => {
312- bindCollection (
313- { target, collection : other , resolve, reject, ops } ,
314- { wait : true }
315- )
265+ bindCollection ( target , other , ops , resolve , reject , { wait : true } )
316266 } )
317267 expect ( target . value ) . toEqual ( [ ] )
318268 await promise
0 commit comments