@@ -358,9 +358,14 @@ class WoTClientTest {
358358 this . clientFactory = new TrapClientFactory ( ) ;
359359 this . servient . addClientFactory ( this . clientFactory ) ;
360360 this . servient . addClientFactory ( new TDClientFactory ( ) ) ;
361- this . servient . start ( ) . then ( ( myWoT ) => {
362- this . WoT = myWoT ;
363- } ) ;
361+ this . servient
362+ . start ( )
363+ . then ( ( myWoT ) => {
364+ this . WoT = myWoT ;
365+ } )
366+ . catch ( ( error ) => {
367+ throw error ;
368+ } ) ;
364369 debug ( "started test suite" ) ;
365370 }
366371
@@ -570,11 +575,17 @@ class WoTClientTest {
570575 expect ( thing ) . to . have . property ( "title" ) . that . equals ( "aThing" ) ;
571576 expect ( thing ) . to . have . property ( "events" ) . that . has . property ( "anEvent" ) ;
572577 return new Promise ( ( resolve ) => {
573- thing . subscribeEvent ( "anEvent" , async ( x ) => {
574- const value = await x . value ( ) ;
575- expect ( value ) . to . equal ( "triggered" ) ;
576- resolve ( true ) ;
577- } ) ;
578+ thing
579+ . subscribeEvent ( "anEvent" , async ( x ) => {
580+ const value = await x . value ( ) ;
581+ expect ( value ) . to . equal ( "triggered" ) ;
582+ resolve ( true ) ;
583+ } )
584+ . catch ( ( error ) => {
585+ throw error ;
586+ } ) ;
587+ } ) . catch ( ( error ) => {
588+ throw error ;
578589 } ) ;
579590 }
580591
@@ -626,17 +637,25 @@ class WoTClientTest {
626637 expect ( thing ) . to . have . property ( "title" ) . that . equals ( "aThing" ) ;
627638 expect ( thing ) . to . have . property ( "events" ) . that . has . property ( "anEvent" ) ;
628639
629- const subscription = await thing . subscribeEvent ( "anEvent" , ( ) => {
630- /** */
631- } ) ;
640+ const subscription = await thing
641+ . subscribeEvent ( "anEvent" , ( ) => {
642+ /** */
643+ } )
644+ . catch ( ( error ) => {
645+ throw error ;
646+ } ) ;
632647 await subscription . stop ( ) ;
633648
634649 return new Promise ( ( resolve ) => {
635- thing . subscribeEvent ( "anEvent" , async ( x ) => {
636- const value = await x . value ( ) ;
637- expect ( value ) . to . equal ( "triggered" ) ;
638- resolve ( true ) ;
639- } ) ;
650+ thing
651+ . subscribeEvent ( "anEvent" , async ( x ) => {
652+ const value = await x . value ( ) ;
653+ expect ( value ) . to . equal ( "triggered" ) ;
654+ resolve ( true ) ;
655+ } )
656+ . catch ( ( error ) => {
657+ throw error ;
658+ } ) ;
640659 } ) ;
641660 }
642661
@@ -649,11 +668,15 @@ class WoTClientTest {
649668 expect ( thing ) . to . have . property ( "title" ) . that . equals ( "aThing" ) ;
650669 expect ( thing ) . to . have . property ( "properties" ) . that . has . property ( "aPropertyToObserve" ) ;
651670 return new Promise ( ( resolve ) => {
652- thing . observeProperty ( "aPropertyToObserve" , async ( data ) => {
653- const value = await data . value ( ) ;
654- expect ( value ) . to . equal ( 12 ) ;
655- resolve ( true ) ;
656- } ) ;
671+ thing
672+ . observeProperty ( "aPropertyToObserve" , async ( data ) => {
673+ const value = await data . value ( ) ;
674+ expect ( value ) . to . equal ( 12 ) ;
675+ resolve ( true ) ;
676+ } )
677+ . catch ( ( error ) => {
678+ throw error ;
679+ } ) ;
657680 } ) ;
658681 }
659682
0 commit comments