@@ -208,11 +208,10 @@ describe('Cloud Code', () => {
208
208
Parse . Cloud . afterFind ( 'beforeFind' , ( ) => {
209
209
throw 'afterFind should not run' ;
210
210
} ) ;
211
- const obj = new Parse . Object ( 'beforeFind' ) ;
212
- await obj . save ( ) ;
213
211
const newObj = await new Parse . Query ( 'beforeFind' ) . first ( ) ;
214
212
expect ( newObj . className ) . toBe ( 'TestObject' ) ;
215
213
expect ( newObj . toJSON ( ) ) . toEqual ( { foo : 'bar' } ) ;
214
+ await newObj . save ( ) ;
216
215
} ) ;
217
216
218
217
it ( 'beforeFind can return array of objects without DB operation' , async ( ) => {
@@ -222,11 +221,10 @@ describe('Cloud Code', () => {
222
221
Parse . Cloud . afterFind ( 'beforeFind' , ( ) => {
223
222
throw 'afterFind should not run' ;
224
223
} ) ;
225
- const obj = new Parse . Object ( 'beforeFind' ) ;
226
- await obj . save ( ) ;
227
224
const newObj = await new Parse . Query ( 'beforeFind' ) . first ( ) ;
228
225
expect ( newObj . className ) . toBe ( 'TestObject' ) ;
229
226
expect ( newObj . toJSON ( ) ) . toEqual ( { foo : 'bar' } ) ;
227
+ await newObj . save ( ) ;
230
228
} ) ;
231
229
232
230
it ( 'beforeFind can return object for get query without DB operation' , async ( ) => {
@@ -236,11 +234,10 @@ describe('Cloud Code', () => {
236
234
Parse . Cloud . afterFind ( 'beforeFind' , ( ) => {
237
235
throw 'afterFind should not run' ;
238
236
} ) ;
239
- const obj = new Parse . Object ( 'beforeFind' ) ;
240
- await obj . save ( ) ;
241
- const newObj = await new Parse . Query ( 'beforeFind' ) . get ( obj . id ) ;
237
+ const newObj = await new Parse . Query ( 'beforeFind' ) . get ( 'objId' ) ;
242
238
expect ( newObj . className ) . toBe ( 'TestObject' ) ;
243
239
expect ( newObj . toJSON ( ) ) . toEqual ( { foo : 'bar' } ) ;
240
+ await newObj . save ( ) ;
244
241
} ) ;
245
242
246
243
it ( 'beforeFind can return empty array without DB operation' , async ( ) => {
0 commit comments