1- import { filter , first } from 'rxjs/operators' ;
2- import { HttpClientTestingModule , HttpTestingController } from '@angular/common/http/testing' ;
1+ import { firstValueFrom } from 'rxjs' ;
2+ import { filter } from 'rxjs/operators' ;
3+ import { HttpTestingController , provideHttpClientTesting } from '@angular/common/http/testing' ;
34import { ApplicationRef , Component , destroyPlatform , getPlatform , NgModule } from '@angular/core' ;
4- import { BrowserModule } from '@angular/platform-browser' ;
55import {
66 INITIAL_CONFIG ,
77 platformServer ,
@@ -66,12 +66,8 @@ describe.skip('integration', () => {
6666
6767 @NgModule ( {
6868 declarations : [ AsyncServerApp ] ,
69- imports : [
70- BrowserModule . withServerTransition ( { appId : 'async-server' } ) ,
71- ServerModule ,
72- HttpClientTestingModule ,
73- ] ,
74- providers : [ HttpLink ] ,
69+ imports : [ ServerModule ] ,
70+ providers : [ provideHttpClientTesting ( ) , HttpLink ] ,
7571 bootstrap : [ AsyncServerApp ] ,
7672 } )
7773 class AsyncServerModule { }
@@ -87,12 +83,7 @@ describe.skip('integration', () => {
8783 ] ) ;
8884 const moduleRef = await platform . bootstrapModule ( AsyncServerModule ) ;
8985 const applicationRef : ApplicationRef = moduleRef . injector . get ( ApplicationRef ) ;
90- await applicationRef . isStable
91- . pipe (
92- filter ( ( isStable : boolean ) => isStable ) ,
93- first ( ) ,
94- )
95- . toPromise ( ) ;
86+ await firstValueFrom ( applicationRef . isStable . pipe ( filter ( isStable => isStable ) ) ) ;
9687 const str = platform . injector . get ( PlatformState ) . renderToString ( ) ;
9788
9889 expect ( clearNgVersion ( str ) ) . toMatchSnapshot ( ) ;
0 commit comments