@@ -793,22 +793,53 @@ describe('platform-server integration', () => {
793793 } ) ;
794794 } ) ) ;
795795
796- it ( 'can make relative HttpClient requests' , async ( ( ) => {
797- const platform = platformDynamicServer ( [
798- { provide : INITIAL_CONFIG , useValue : { document : '<app></app>' , url : 'http://localhost' } }
799- ] ) ;
800- platform . bootstrapModule ( HttpClientExampleModule ) . then ( ref => {
801- const mock = ref . injector . get ( HttpTestingController ) as HttpTestingController ;
802- const http = ref . injector . get ( HttpClient ) ;
803- ref . injector . get < NgZone > ( NgZone ) . run ( ( ) => {
804- http . get < string > ( '/testing' ) . subscribe ( ( body : string ) => {
805- NgZone . assertInAngularZone ( ) ;
806- expect ( body ) . toEqual ( 'success!' ) ;
807- } ) ;
808- mock . expectOne ( 'http://localhost/testing' ) . flush ( 'success!' ) ;
809- } ) ;
810- } ) ;
811- } ) ) ;
796+ it ( 'can make relative HttpClient requests' , async ( ) => {
797+ const platform = platformDynamicServer ( [
798+ { provide : INITIAL_CONFIG , useValue : { document : '<app></app>' , url : 'http://localhost' } }
799+ ] ) ;
800+ const ref = await platform . bootstrapModule ( HttpClientExampleModule ) ;
801+ const mock = ref . injector . get ( HttpTestingController ) as HttpTestingController ;
802+ const http = ref . injector . get ( HttpClient ) ;
803+ ref . injector . get ( NgZone ) . run ( ( ) => {
804+ http . get < string > ( '/testing' ) . subscribe ( ( body : string ) => {
805+ NgZone . assertInAngularZone ( ) ;
806+ expect ( body ) . toEqual ( 'success!' ) ;
807+ } ) ;
808+ mock . expectOne ( 'http://localhost/testing' ) . flush ( 'success!' ) ;
809+ } ) ;
810+ } ) ;
811+
812+ it ( 'can make relative HttpClient requests two slashes' , async ( ) => {
813+ const platform = platformDynamicServer ( [
814+ { provide : INITIAL_CONFIG , useValue : { document : '<app></app>' , url : 'http://localhost/' } }
815+ ] ) ;
816+ const ref = await platform . bootstrapModule ( HttpClientExampleModule ) ;
817+ const mock = ref . injector . get ( HttpTestingController ) as HttpTestingController ;
818+ const http = ref . injector . get ( HttpClient ) ;
819+ ref . injector . get ( NgZone ) . run ( ( ) => {
820+ http . get < string > ( '/testing' ) . subscribe ( ( body : string ) => {
821+ NgZone . assertInAngularZone ( ) ;
822+ expect ( body ) . toEqual ( 'success!' ) ;
823+ } ) ;
824+ mock . expectOne ( 'http://localhost/testing' ) . flush ( 'success!' ) ;
825+ } ) ;
826+ } ) ;
827+
828+ it ( 'can make relative HttpClient requests no slashes' , async ( ) => {
829+ const platform = platformDynamicServer ( [
830+ { provide : INITIAL_CONFIG , useValue : { document : '<app></app>' , url : 'http://localhost' } }
831+ ] ) ;
832+ const ref = await platform . bootstrapModule ( HttpClientExampleModule ) ;
833+ const mock = ref . injector . get ( HttpTestingController ) as HttpTestingController ;
834+ const http = ref . injector . get ( HttpClient ) ;
835+ ref . injector . get ( NgZone ) . run ( ( ) => {
836+ http . get < string > ( 'testing' ) . subscribe ( ( body : string ) => {
837+ NgZone . assertInAngularZone ( ) ;
838+ expect ( body ) . toEqual ( 'success!' ) ;
839+ } ) ;
840+ mock . expectOne ( 'http://localhost/testing' ) . flush ( 'success!' ) ;
841+ } ) ;
842+ } ) ;
812843
813844 it ( 'requests are macrotasks' , async ( ( ) => {
814845 const platform = platformDynamicServer (
0 commit comments