File tree 1 file changed +13
-2
lines changed
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,18 @@ describe("FastBoot", function() {
106
106
distPath : fixture ( 'basic-app' )
107
107
} ) ;
108
108
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 } )
110
121
. catch ( ( e ) => {
111
122
expect ( e . message ) . to . equal ( 'App instance was forcefully destroyed in 5ms' ) ;
112
123
done ( ) ;
@@ -349,7 +360,7 @@ describe("FastBoot", function() {
349
360
distPath : fixture ( 'boot-time-failing-app' )
350
361
} ) ;
351
362
352
- return fastboot . visit ( '/' )
363
+ fastboot . visit ( '/' )
353
364
. catch ( ( e ) => {
354
365
expect ( e ) . to . be . an ( 'error' ) ;
355
366
done ( ) ;
You can’t perform that action at this time.
0 commit comments