mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
This reverts commit 19ec8266d1.
PR Close #59380
This commit is contained in:
parent
0bf6f7602e
commit
dc8280d950
1 changed files with 5 additions and 9 deletions
|
|
@ -65,8 +65,8 @@ function dynamicImportOf<T>(type: T, timeout = 0): Promise<T> {
|
|||
* Helper function to await all pending dynamic imports
|
||||
* emulated using `dynamicImportOf` function.
|
||||
*/
|
||||
function allPendingDynamicImports(timeout?: number) {
|
||||
return dynamicImportOf(null, timeout ?? 10);
|
||||
function allPendingDynamicImports() {
|
||||
return dynamicImportOf(null, 101);
|
||||
}
|
||||
|
||||
describe('platform-server partial hydration integration', () => {
|
||||
|
|
@ -2364,12 +2364,10 @@ describe('platform-server partial hydration integration', () => {
|
|||
location = inject(Location);
|
||||
}
|
||||
|
||||
const dynamicImportTimeout = 5; // ms
|
||||
|
||||
const deferDepsInterceptor = {
|
||||
intercept() {
|
||||
return () => {
|
||||
return [dynamicImportOf(DeferredCmp, dynamicImportTimeout)];
|
||||
return [dynamicImportOf(DeferredCmp, 100)];
|
||||
};
|
||||
},
|
||||
};
|
||||
|
|
@ -2399,12 +2397,10 @@ describe('platform-server partial hydration integration', () => {
|
|||
|
||||
const routeLink = doc.getElementById('route-link')!;
|
||||
routeLink.click();
|
||||
// Wait a bit longer than a timeout used to emulate a dynamic import.
|
||||
await allPendingDynamicImports(dynamicImportTimeout * 2);
|
||||
await allPendingDynamicImports();
|
||||
appRef.tick();
|
||||
|
||||
// Wait a bit longer than a timeout used to emulate a dynamic import.
|
||||
await allPendingDynamicImports(dynamicImportTimeout * 2);
|
||||
await allPendingDynamicImports();
|
||||
await appRef.whenStable();
|
||||
|
||||
expect(location.path()).toBe('/other/thing/stuff');
|
||||
|
|
|
|||
Loading…
Reference in a new issue