File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,18 @@ describe("FastBoot", function() {
106106 distPath : fixture ( 'basic-app' )
107107 } ) ;
108108
109- return fastboot . visit ( '/' , { destroyAppInstanceInMs : 5 } )
109+ // delaying `visitRoute` to forcefully destroy app instance
110+ let originalVisitRoute = fastboot . _app . visitRoute ;
111+ fastboot . _app . visitRoute = function ( ) {
112+ return originalVisitRoute . apply ( this , arguments )
113+ . then ( function ( ) {
114+ return new Promise ( function ( resolve ) {
115+ setTimeout ( resolve , 2000 ) ;
116+ } ) ;
117+ } ) ;
118+ } ;
119+
120+ fastboot . visit ( '/' , { destroyAppInstanceInMs : 5 } )
110121 . catch ( ( e ) => {
111122 expect ( e . message ) . to . equal ( 'App instance was forcefully destroyed in 5ms' ) ;
112123 done ( ) ;
@@ -349,7 +360,7 @@ describe("FastBoot", function() {
349360 distPath : fixture ( 'boot-time-failing-app' )
350361 } ) ;
351362
352- return fastboot . visit ( '/' )
363+ fastboot . visit ( '/' )
353364 . catch ( ( e ) => {
354365 expect ( e ) . to . be . an ( 'error' ) ;
355366 done ( ) ;
You can’t perform that action at this time.
0 commit comments