@@ -421,8 +421,8 @@ describe('Hooks', () => {
421
421
// But this should override the key upon return
422
422
res . json ( { success : object } ) ;
423
423
} ) ;
424
- // The function is delete as the DB is dropped between calls
425
- Parse . Hooks . createTrigger ( "SomeRandomObject" , "beforeSave" , hookServerURL + "/BeforeSaveSome" ) . then ( function ( ) {
424
+ // The function is deleted as the DB is dropped between calls
425
+ Parse . Hooks . createTrigger ( "SomeRandomObject" , "beforeSave" , hookServerURL + "/BeforeSaveSome" ) . then ( function ( ) {
426
426
const obj = new Parse . Object ( "SomeRandomObject" ) ;
427
427
return obj . save ( ) ;
428
428
} ) . then ( function ( res ) {
@@ -444,7 +444,7 @@ describe('Hooks', () => {
444
444
object . set ( 'hello' , "world" ) ;
445
445
res . json ( { success : object } ) ;
446
446
} ) ;
447
- Parse . Hooks . createTrigger ( "SomeRandomObject2" , "beforeSave" , hookServerURL + "/BeforeSaveSome2" ) . then ( function ( ) {
447
+ Parse . Hooks . createTrigger ( "SomeRandomObject2" , "beforeSave" , hookServerURL + "/BeforeSaveSome2" ) . then ( function ( ) {
448
448
const obj = new Parse . Object ( "SomeRandomObject2" ) ;
449
449
return obj . save ( ) ;
450
450
} ) . then ( function ( res ) {
@@ -470,20 +470,19 @@ describe('Hooks', () => {
470
470
res . json ( { success : { } } ) ;
471
471
} )
472
472
} ) ;
473
- // The function is delete as the DB is dropped between calls
474
- Parse . Hooks . createTrigger ( "SomeRandomObject" , "afterSave" , hookServerURL + "/AfterSaveSome" ) . then ( function ( ) {
473
+ // The function is deleted as the DB is dropped between calls
474
+ Parse . Hooks . createTrigger ( "SomeRandomObject" , "afterSave" , hookServerURL + "/AfterSaveSome" ) . then ( function ( ) {
475
475
const obj = new Parse . Object ( "SomeRandomObject" ) ;
476
476
return obj . save ( ) ;
477
477
} ) . then ( function ( ) {
478
478
var promise = new Parse . Promise ( ) ;
479
- // Wait a bit here as it's an after save
480
- setTimeout ( function ( ) {
479
+ // Wait a bit here as it's an after save
480
+ setTimeout ( ( ) => {
481
481
expect ( triggerCount ) . toBe ( 1 ) ;
482
- var q = new Parse . Query ( "AnotherObject" ) ;
483
- q . get ( newObjectId ) . then ( function ( r ) {
484
- promise . resolve ( r ) ;
485
- } ) ;
486
- } , 300 )
482
+ new Parse . Query ( "AnotherObject" )
483
+ . get ( newObjectId )
484
+ . then ( ( r ) => promise . resolve ( r ) ) ;
485
+ } , 500 ) ;
487
486
return promise ;
488
487
} ) . then ( function ( res ) {
489
488
expect ( res . get ( "foo" ) ) . toEqual ( "bar" ) ;
0 commit comments