@@ -421,8 +421,8 @@ describe('Hooks', () => {
421421 // But this should override the key upon return
422422 res . json ( { success : object } ) ;
423423 } ) ;
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 ( ) {
426426 const obj = new Parse . Object ( "SomeRandomObject" ) ;
427427 return obj . save ( ) ;
428428 } ) . then ( function ( res ) {
@@ -444,7 +444,7 @@ describe('Hooks', () => {
444444 object . set ( 'hello' , "world" ) ;
445445 res . json ( { success : object } ) ;
446446 } ) ;
447- Parse . Hooks . createTrigger ( "SomeRandomObject2" , "beforeSave" , hookServerURL + "/BeforeSaveSome2" ) . then ( function ( ) {
447+ Parse . Hooks . createTrigger ( "SomeRandomObject2" , "beforeSave" , hookServerURL + "/BeforeSaveSome2" ) . then ( function ( ) {
448448 const obj = new Parse . Object ( "SomeRandomObject2" ) ;
449449 return obj . save ( ) ;
450450 } ) . then ( function ( res ) {
@@ -470,20 +470,19 @@ describe('Hooks', () => {
470470 res . json ( { success : { } } ) ;
471471 } )
472472 } ) ;
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 ( ) {
475475 const obj = new Parse . Object ( "SomeRandomObject" ) ;
476476 return obj . save ( ) ;
477477 } ) . then ( function ( ) {
478478 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 ( ( ) => {
481481 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 ) ;
487486 return promise ;
488487 } ) . then ( function ( res ) {
489488 expect ( res . get ( "foo" ) ) . toEqual ( "bar" ) ;
0 commit comments