@@ -65,8 +65,8 @@ function dynamicImportOf<T>(type: T, timeout = 0): Promise<T> {
6565 * Helper function to await all pending dynamic imports
6666 * emulated using `dynamicImportOf` function.
6767 */
68- function allPendingDynamicImports ( timeout ?: number ) {
69- return dynamicImportOf ( null , timeout ?? 10 ) ;
68+ function allPendingDynamicImports ( ) {
69+ return dynamicImportOf ( null , 101 ) ;
7070}
7171
7272describe ( 'platform-server partial hydration integration' , ( ) => {
@@ -2364,12 +2364,10 @@ describe('platform-server partial hydration integration', () => {
23642364 location = inject ( Location ) ;
23652365 }
23662366
2367- const dynamicImportTimeout = 5 ; // ms
2368-
23692367 const deferDepsInterceptor = {
23702368 intercept ( ) {
23712369 return ( ) => {
2372- return [ dynamicImportOf ( DeferredCmp , dynamicImportTimeout ) ] ;
2370+ return [ dynamicImportOf ( DeferredCmp , 100 ) ] ;
23732371 } ;
23742372 } ,
23752373 } ;
@@ -2399,12 +2397,10 @@ describe('platform-server partial hydration integration', () => {
23992397
24002398 const routeLink = doc . getElementById ( 'route-link' ) ! ;
24012399 routeLink . click ( ) ;
2402- // Wait a bit longer than a timeout used to emulate a dynamic import.
2403- await allPendingDynamicImports ( dynamicImportTimeout * 2 ) ;
2400+ await allPendingDynamicImports ( ) ;
24042401 appRef . tick ( ) ;
24052402
2406- // Wait a bit longer than a timeout used to emulate a dynamic import.
2407- await allPendingDynamicImports ( dynamicImportTimeout * 2 ) ;
2403+ await allPendingDynamicImports ( ) ;
24082404 await appRef . whenStable ( ) ;
24092405
24102406 expect ( location . path ( ) ) . toBe ( '/other/thing/stuff' ) ;
0 commit comments