File tree Expand file tree Collapse file tree 1 file changed +4
-12
lines changed
packages/angular_devkit/build_angular/src/builders/dev-server/specs Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -114,19 +114,11 @@ describe('Dev Server Builder ssl', () => {
114114 expect ( output . success ) . toBe ( true ) ;
115115 expect ( output . baseUrl ) . toMatch ( / ^ h t t p s : \/ \/ l o c a l h o s t : \d + \/ / ) ;
116116
117- // The self-signed certificate used by the dev server will cause fetch to fail
118- // unless reject unauthorized is disabled.
119- const originalDispatcher = getGlobalDispatcher ( ) ;
120- setGlobalDispatcher (
121- new Agent ( {
117+ const response = await fetch ( output . baseUrl , {
118+ dispatcher : new Agent ( {
122119 connect : { rejectUnauthorized : false } ,
123120 } ) ,
124- ) ;
125- try {
126- const response = await fetch ( output . baseUrl ) ;
127- expect ( await response . text ( ) ) . toContain ( '<title>HelloWorldApp</title>' ) ;
128- } finally {
129- setGlobalDispatcher ( originalDispatcher ) ;
130- }
121+ } ) ;
122+ expect ( await response . text ( ) ) . toContain ( '<title>HelloWorldApp</title>' ) ;
131123 } ) ;
132124} ) ;
You can’t perform that action at this time.
0 commit comments