@@ -13,13 +13,13 @@ describe('Array Operations', () => {
1313 } ) ;
1414
1515 it ( 'initializes a field' , ( done ) => {
16- let object = new Parse . Object ( 'TestObject' ) ;
16+ const object = new Parse . Object ( 'TestObject' ) ;
1717 object . set ( 'strings' , [ 'foo' , 'bar' , 'baz' ] ) ;
1818 object . save ( ) . then ( ( ) => {
19- let query = new Parse . Query ( 'TestObject' ) ;
19+ const query = new Parse . Query ( 'TestObject' ) ;
2020 return query . get ( object . id ) ;
2121 } ) . then ( ( o ) => {
22- let strings = o . get ( 'strings' ) ;
22+ const strings = o . get ( 'strings' ) ;
2323 assert . equal ( strings . length , 3 ) ;
2424 assert . equal ( strings [ 0 ] , 'foo' ) ;
2525 assert . equal ( strings [ 1 ] , 'bar' ) ;
@@ -29,18 +29,18 @@ describe('Array Operations', () => {
2929 } ) ;
3030
3131 it ( 'adds values' , ( done ) => {
32- let object = new Parse . Object ( 'TestObject' ) ;
32+ const object = new Parse . Object ( 'TestObject' ) ;
3333 object . set ( 'strings' , [ 'foo' ] ) ;
3434 object . save ( ) . then ( ( ) => {
3535 object . add ( 'strings' , 'foo' ) ;
3636 object . add ( 'strings' , 'bar' ) ;
3737 object . add ( 'strings' , 'baz' ) ;
3838 return object . save ( ) ;
3939 } ) . then ( ( ) => {
40- let query = new Parse . Query ( 'TestObject' ) ;
40+ const query = new Parse . Query ( 'TestObject' ) ;
4141 return query . get ( object . id ) ;
4242 } ) . then ( ( o ) => {
43- let strings = o . get ( 'strings' ) ;
43+ const strings = o . get ( 'strings' ) ;
4444 assert . equal ( strings . length , 4 ) ;
4545 assert . equal ( strings [ 0 ] , 'foo' ) ;
4646 assert . equal ( strings [ 1 ] , 'foo' ) ;
@@ -51,14 +51,14 @@ describe('Array Operations', () => {
5151 } ) ;
5252
5353 it ( 'adds values on a fresh object' , ( done ) => {
54- let object = new Parse . Object ( 'TestObject' ) ;
54+ const object = new Parse . Object ( 'TestObject' ) ;
5555 object . add ( 'strings' , 'foo' ) ;
5656 object . add ( 'strings' , 'bar' ) ;
5757 object . add ( 'strings' , 'baz' ) ;
5858 object . save ( ) . then ( ( ) => {
5959 return new Parse . Query ( 'TestObject' ) . get ( object . id ) ;
6060 } ) . then ( ( o ) => {
61- let strings = o . get ( 'strings' ) ;
61+ const strings = o . get ( 'strings' ) ;
6262 assert . equal ( strings . length , 3 ) ;
6363 assert . equal ( strings [ 0 ] , 'foo' ) ;
6464 assert . equal ( strings [ 1 ] , 'bar' ) ;
@@ -68,7 +68,7 @@ describe('Array Operations', () => {
6868 } ) ;
6969
7070 it ( 'sets then adds objects' , ( done ) => {
71- let object = new Parse . Object ( 'TestObject' ) ;
71+ const object = new Parse . Object ( 'TestObject' ) ;
7272 object . set ( 'strings' , [ 'foo' ] ) ;
7373 object . save ( ) . then ( ( ) => {
7474 object . set ( 'strings' , [ 'bar' ] ) ;
@@ -78,7 +78,7 @@ describe('Array Operations', () => {
7878 } ) . then ( ( ) => {
7979 return new Parse . Query ( 'TestObject' ) . get ( object . id ) ;
8080 } ) . then ( ( o ) => {
81- let strings = o . get ( 'strings' ) ;
81+ const strings = o . get ( 'strings' ) ;
8282 assert . equal ( strings . length , 3 ) ;
8383 assert . equal ( strings [ 0 ] , 'bar' ) ;
8484 assert . equal ( strings [ 1 ] , 'bar' ) ;
@@ -88,7 +88,7 @@ describe('Array Operations', () => {
8888 } ) ;
8989
9090 it ( 'adds values atomically' , ( done ) => {
91- let object = new Parse . Object ( 'TestObject' ) ;
91+ const object = new Parse . Object ( 'TestObject' ) ;
9292 object . set ( 'strings' , [ 'foo' ] ) ;
9393 object . save ( ) . then ( ( ) => {
9494 return new Parse . Query ( 'TestObject' ) . get ( object . id ) ;
@@ -105,14 +105,14 @@ describe('Array Operations', () => {
105105 } ) . then ( ( ) => {
106106 return new Parse . Query ( 'TestObject' ) . get ( object . id ) ;
107107 } ) . then ( ( o ) => {
108- let strings = o . get ( 'strings' ) ;
108+ const strings = o . get ( 'strings' ) ;
109109 assert . equal ( strings . length , 5 ) ;
110110 done ( ) ;
111111 } ) ;
112112 } ) ;
113113
114114 it ( 'adds unique values' , ( done ) => {
115- let object = new Parse . Object ( 'TestObject' ) ;
115+ const object = new Parse . Object ( 'TestObject' ) ;
116116 object . set ( 'strings' , [ 'foo' ] ) ;
117117 object . save ( ) . then ( ( ) => {
118118 object . addUnique ( 'strings' , 'foo' ) ;
@@ -123,7 +123,7 @@ describe('Array Operations', () => {
123123 } ) . then ( ( ) => {
124124 return new Parse . Query ( 'TestObject' ) . get ( object . id ) ;
125125 } ) . then ( ( o ) => {
126- let strings = o . get ( 'strings' ) ;
126+ const strings = o . get ( 'strings' ) ;
127127 strings . sort ( ) ;
128128 assert . equal ( strings . length , 3 ) ;
129129 assert . equal ( strings [ 0 ] , 'bar' ) ;
@@ -134,15 +134,15 @@ describe('Array Operations', () => {
134134 } ) ;
135135
136136 it ( 'adds unique values on a fresh object' , ( done ) => {
137- let object = new Parse . Object ( 'TestObject' ) ;
137+ const object = new Parse . Object ( 'TestObject' ) ;
138138 object . addUnique ( 'strings' , 'foo' ) ;
139139 object . addUnique ( 'strings' , 'bar' ) ;
140140 object . addUnique ( 'strings' , 'foo' ) ;
141141 object . addUnique ( 'strings' , 'baz' ) ;
142142 object . save ( ) . then ( ( ) => {
143143 return new Parse . Query ( 'TestObject' ) . get ( object . id ) ;
144144 } ) . then ( ( o ) => {
145- let strings = o . get ( 'strings' ) ;
145+ const strings = o . get ( 'strings' ) ;
146146 strings . sort ( ) ;
147147 assert . equal ( strings . length , 3 ) ;
148148 assert . equal ( strings [ 0 ] , 'bar' ) ;
@@ -153,7 +153,7 @@ describe('Array Operations', () => {
153153 } ) ;
154154
155155 it ( 'adds unique values after a set' , ( ) => {
156- let object = new Parse . Object ( 'TestObject' ) ;
156+ const object = new Parse . Object ( 'TestObject' ) ;
157157 object . set ( 'numbers' , [ 1 , 2 , 3 , 3 , 4 , 4 ] ) ;
158158 [ 1 , 4 , 4 , 5 ] . forEach ( ( number ) => {
159159 object . addUnique ( 'numbers' , number ) ;
@@ -162,7 +162,7 @@ describe('Array Operations', () => {
162162 } ) ;
163163
164164 it ( 'adds unique values atomically' , ( done ) => {
165- let object = new Parse . Object ( 'TestObject' ) ;
165+ const object = new Parse . Object ( 'TestObject' ) ;
166166 object . set ( 'strings' , [ 'foo' ] ) ;
167167 object . save ( ) . then ( ( ) => {
168168 return new Parse . Query ( 'TestObject' ) . get ( object . id ) ;
@@ -178,7 +178,7 @@ describe('Array Operations', () => {
178178 } ) . then ( ( ) => {
179179 return new Parse . Query ( 'TestObject' ) . get ( object . id ) ;
180180 } ) . then ( ( o ) => {
181- let strings = o . get ( 'strings' ) ;
181+ const strings = o . get ( 'strings' ) ;
182182 strings . sort ( ) ;
183183 assert . equal ( strings . length , 4 ) ;
184184 assert . equal ( strings [ 0 ] , 'bar' ) ;
@@ -190,7 +190,7 @@ describe('Array Operations', () => {
190190 } ) ;
191191
192192 it ( 'removes values' , ( done ) => {
193- let object = new Parse . Object ( 'TestObject' ) ;
193+ const object = new Parse . Object ( 'TestObject' ) ;
194194 object . set ( 'strings' , [ 'foo' , 'foo' , 'bar' , 'baz' ] ) ;
195195 object . save ( ) . then ( ( ) => {
196196 object . remove ( 'strings' , 'foo' ) ;
@@ -200,15 +200,15 @@ describe('Array Operations', () => {
200200 } ) . then ( ( ) => {
201201 return new Parse . Query ( 'TestObject' ) . get ( object . id ) ;
202202 } ) . then ( ( o ) => {
203- let strings = o . get ( 'strings' ) ;
203+ const strings = o . get ( 'strings' ) ;
204204 assert . equal ( strings . length , 1 ) ;
205205 assert . equal ( strings [ 0 ] , 'bar' ) ;
206206 done ( ) ;
207207 } ) ;
208208 } ) ;
209209
210210 it ( 'sets then removes values' , ( done ) => {
211- let object = new Parse . Object ( 'TestObject' ) ;
211+ const object = new Parse . Object ( 'TestObject' ) ;
212212 object . set ( 'strings' , [ 'foo' ] ) ;
213213 object . save ( ) . then ( ( ) => {
214214 object . set ( 'strings' , [ 'bar' , 'baz' , 'bat' ] ) ;
@@ -219,29 +219,29 @@ describe('Array Operations', () => {
219219 } ) . then ( ( ) => {
220220 return new Parse . Query ( 'TestObject' ) . get ( object . id ) ;
221221 } ) . then ( ( o ) => {
222- let strings = o . get ( 'strings' ) ;
222+ const strings = o . get ( 'strings' ) ;
223223 assert . equal ( strings . length , 1 ) ;
224224 assert . equal ( strings [ 0 ] , 'bat' ) ;
225225 done ( ) ;
226226 } ) ;
227227 } ) ;
228228
229229 it ( 'removes values on a fresh object' , ( done ) => {
230- let object = new Parse . Object ( 'TestObject' ) ;
230+ const object = new Parse . Object ( 'TestObject' ) ;
231231 object . remove ( 'strings' , 'foo' ) ;
232232 object . remove ( 'strings' , 'baz' ) ;
233233 object . remove ( 'strings' , 'bat' ) ;
234234 object . save ( ) . then ( ( ) => {
235235 return new Parse . Query ( 'TestObject' ) . get ( object . id ) ;
236236 } ) . then ( ( o ) => {
237- let strings = o . get ( 'strings' ) ;
237+ const strings = o . get ( 'strings' ) ;
238238 assert . equal ( strings . length , 0 ) ;
239239 done ( ) ;
240240 } ) ;
241241 } ) ;
242242
243243 it ( 'removes values atomically' , ( done ) => {
244- let object = new Parse . Object ( 'TestObject' ) ;
244+ const object = new Parse . Object ( 'TestObject' ) ;
245245 object . set ( 'strings' , [ 'foo' , 'foo' , 'bar' , 'baz' ] ) ;
246246 object . save ( ) . then ( ( ) => {
247247 return new Parse . Query ( 'TestObject' ) . get ( object . id ) ;
@@ -257,7 +257,7 @@ describe('Array Operations', () => {
257257 } ) . then ( ( ) => {
258258 return new Parse . Query ( 'TestObject' ) . get ( object . id ) ;
259259 } ) . then ( ( o ) => {
260- let strings = o . get ( 'strings' ) ;
260+ const strings = o . get ( 'strings' ) ;
261261 strings . sort ( ) ;
262262 assert . equal ( strings . length , 1 ) ;
263263 assert . equal ( strings [ 0 ] , 'baz' ) ;
@@ -266,7 +266,7 @@ describe('Array Operations', () => {
266266 } ) ;
267267
268268 it ( 'fails when combining add unique with add' , ( done ) => {
269- let object = new Parse . Object ( 'TestObject' ) ;
269+ const object = new Parse . Object ( 'TestObject' ) ;
270270 object . set ( 'strings' , [ 'foo' , 'bar' ] ) ;
271271 object . save ( ) . then ( ( ) => {
272272 object . add ( 'strings' , 'bar' ) ;
@@ -278,7 +278,7 @@ describe('Array Operations', () => {
278278 } ) ;
279279
280280 it ( 'fails when combining add with add unique' , ( done ) => {
281- let object = new Parse . Object ( 'TestObject' ) ;
281+ const object = new Parse . Object ( 'TestObject' ) ;
282282 object . set ( 'strings' , [ 'foo' , 'bar' ] ) ;
283283 object . save ( ) . then ( ( ) => {
284284 object . addUnique ( 'strings' , 'bar' ) ;
@@ -290,7 +290,7 @@ describe('Array Operations', () => {
290290 } ) ;
291291
292292 it ( 'fails when combining remove with add' , ( done ) => {
293- let object = new Parse . Object ( 'TestObject' ) ;
293+ const object = new Parse . Object ( 'TestObject' ) ;
294294 object . set ( 'strings' , [ 'foo' , 'bar' ] ) ;
295295 object . save ( ) . then ( ( ) => {
296296 object . add ( 'strings' , 'bar' ) ;
@@ -302,7 +302,7 @@ describe('Array Operations', () => {
302302 } ) ;
303303
304304 it ( 'fails when combining add with remove' , ( done ) => {
305- let object = new Parse . Object ( 'TestObject' ) ;
305+ const object = new Parse . Object ( 'TestObject' ) ;
306306 object . set ( 'strings' , [ 'foo' , 'bar' ] ) ;
307307 object . save ( ) . then ( ( ) => {
308308 object . remove ( 'strings' , 'bar' ) ;
@@ -314,7 +314,7 @@ describe('Array Operations', () => {
314314 } ) ;
315315
316316 it ( 'fails when combining remove with add unique' , ( done ) => {
317- let object = new Parse . Object ( 'TestObject' ) ;
317+ const object = new Parse . Object ( 'TestObject' ) ;
318318 object . set ( 'strings' , [ 'foo' , 'bar' ] ) ;
319319 object . save ( ) . then ( ( ) => {
320320 object . addUnique ( 'strings' , 'bar' ) ;
@@ -326,7 +326,7 @@ describe('Array Operations', () => {
326326 } ) ;
327327
328328 it ( 'fails when combining remove with add unique' , ( done ) => {
329- let object = new Parse . Object ( 'TestObject' ) ;
329+ const object = new Parse . Object ( 'TestObject' ) ;
330330 object . set ( 'strings' , [ 'foo' , 'bar' ] ) ;
331331 object . save ( ) . then ( ( ) => {
332332 object . remove ( 'strings' , 'bar' ) ;
@@ -338,47 +338,47 @@ describe('Array Operations', () => {
338338 } ) ;
339339
340340 it ( 'adds unique objects by id' , ( done ) => {
341- let snowflake = new Parse . Object ( 'Snowflake' ) ;
342- let pocket = new Parse . Object ( 'Pocket' ) ;
341+ const snowflake = new Parse . Object ( 'Snowflake' ) ;
342+ const pocket = new Parse . Object ( 'Pocket' ) ;
343343 snowflake . set ( 'color' , 'white' ) ;
344344 snowflake . save ( ) . then ( ( ) => {
345345 pocket . set ( 'snowflakes' , [ snowflake ] ) ;
346- let snowflakeQuery = new Parse . Query ( 'Snowflake' ) ;
346+ const snowflakeQuery = new Parse . Query ( 'Snowflake' ) ;
347347 return snowflakeQuery . get ( snowflake . id ) ;
348348 } ) . then ( ( flake ) => {
349349 pocket . addUnique ( 'snowflakes' , flake ) ;
350350 assert . equal ( pocket . get ( 'snowflakes' ) . length , 1 ) ;
351351 return pocket . save ( ) ;
352352 } ) . then ( ( ) => {
353- let pocketQuery = new Parse . Query ( 'Pocket' ) ;
353+ const pocketQuery = new Parse . Query ( 'Pocket' ) ;
354354 pocketQuery . include ( 'snowflakes' ) ;
355355 return pocketQuery . get ( pocket . id ) ;
356356 } ) . then ( ( newPocket ) => {
357357 assert . notEqual ( pocket , newPocket ) ;
358358 assert . equal ( newPocket . get ( 'snowflakes' ) . length , 1 ) ;
359- let flake = newPocket . get ( 'snowflakes' ) [ 0 ] ;
359+ const flake = newPocket . get ( 'snowflakes' ) [ 0 ] ;
360360 assert . equal ( flake . get ( 'color' ) , 'white' ) ;
361361 done ( ) ;
362362 } ) ;
363363 } ) ;
364364
365365 it ( 'removes objects by id' , ( done ) => {
366- let badEgg = new Parse . Object ( 'Egg' ) ;
366+ const badEgg = new Parse . Object ( 'Egg' ) ;
367367 badEgg . set ( 'quality' , 'rotten' ) ;
368- let goodEgg = new Parse . Object ( 'Egg' ) ;
368+ const goodEgg = new Parse . Object ( 'Egg' ) ;
369369 goodEgg . set ( 'quality' , 'good' ) ;
370- let ostrichEgg = new Parse . Object ( 'Egg' ) ;
370+ const ostrichEgg = new Parse . Object ( 'Egg' ) ;
371371 ostrichEgg . set ( 'quality' , 'huge' ) ;
372- let eggs = [ badEgg , goodEgg , ostrichEgg ] ;
373- let shelf = new Parse . Object ( 'Shelf' ) ;
372+ const eggs = [ badEgg , goodEgg , ostrichEgg ] ;
373+ const shelf = new Parse . Object ( 'Shelf' ) ;
374374 Parse . Object . saveAll ( eggs ) . then ( ( ) => {
375375 shelf . set ( 'eggs' , eggs ) ;
376- let badEggQuery = new Parse . Query ( 'Egg' ) ;
376+ const badEggQuery = new Parse . Query ( 'Egg' ) ;
377377 return badEggQuery . get ( badEgg . id ) ;
378378 } ) . then ( ( badEggRef ) => {
379379 assert . notEqual ( badEgg , badEggRef ) ;
380380 shelf . remove ( 'eggs' , badEggRef ) ;
381- let fetchedEggs = shelf . get ( 'eggs' ) ;
381+ const fetchedEggs = shelf . get ( 'eggs' ) ;
382382 assert . equal ( fetchedEggs . length , 2 ) ;
383383 assert . equal ( fetchedEggs [ 0 ] . get ( 'quality' ) , 'good' ) ;
384384 assert . equal ( fetchedEggs [ 1 ] . get ( 'quality' ) , 'huge' ) ;
0 commit comments