@@ -14,78 +14,42 @@ export default function () {
14
14
const publicHost = `${ firstLocalIp } :4200` ;
15
15
const localAddress = `http://${ publicHost } ` ;
16
16
17
- return (
18
- Promise . resolve ( )
19
- // Disabling this test. Webpack Dev Server does not check the hots anymore when binding to
20
- // numeric IP addresses.
21
- // .then(() => ngServe('--host=0.0.0.0'))
22
- // .then(() => fetch(localAddress))
23
- // .then((response) => response.text())
24
- // .then(body => {
25
- // if (!body.match(/Invalid Host header/)) {
26
- // throw new Error('Response does not match expected value.');
27
- // }
28
- // })
29
- // .then(() => killAllProcesses(), (err) => { killAllProcesses(); throw err; })
30
- . then ( ( ) => ngServe ( '--host=0.0.0.0' , `--public-host=${ publicHost } ` ) )
31
- . then ( ( ) => fetch ( localAddress ) )
32
- . then ( ( response ) => response . text ( ) )
33
- . then ( ( body ) => {
34
- if ( ! body . match ( / < a p p - r o o t > < \/ a p p - r o o t > / ) ) {
35
- throw new Error ( 'Response does not match expected value.' ) ;
36
- }
37
- } )
38
- . then (
39
- ( ) => killAllProcesses ( ) ,
40
- ( err ) => {
41
- killAllProcesses ( ) ;
42
- throw err ;
43
- } ,
44
- )
45
- . then ( ( ) => ngServe ( '--host=0.0.0.0' , `--disable-host-check` ) )
46
- . then ( ( ) => fetch ( localAddress ) )
47
- . then ( ( response ) => response . text ( ) )
48
- . then ( ( body ) => {
49
- if ( ! body . match ( / < a p p - r o o t > < \/ a p p - r o o t > / ) ) {
50
- throw new Error ( 'Response does not match expected value.' ) ;
51
- }
52
- } )
53
- . then (
54
- ( ) => killAllProcesses ( ) ,
55
- ( err ) => {
56
- killAllProcesses ( ) ;
57
- throw err ;
58
- } ,
59
- )
60
- . then ( ( ) => ngServe ( '--host=0.0.0.0' , `--public-host=${ localAddress } ` ) )
61
- . then ( ( ) => fetch ( localAddress ) )
62
- . then ( ( response ) => response . text ( ) )
63
- . then ( ( body ) => {
64
- if ( ! body . match ( / < a p p - r o o t > < \/ a p p - r o o t > / ) ) {
65
- throw new Error ( 'Response does not match expected value.' ) ;
66
- }
67
- } )
68
- . then (
69
- ( ) => killAllProcesses ( ) ,
70
- ( err ) => {
71
- killAllProcesses ( ) ;
72
- throw err ;
73
- } ,
74
- )
75
- . then ( ( ) => ngServe ( '--host=0.0.0.0' , `--public-host=${ firstLocalIp } ` ) )
76
- . then ( ( ) => fetch ( localAddress ) )
77
- . then ( ( response ) => response . text ( ) )
78
- . then ( ( body ) => {
79
- if ( ! body . match ( / < a p p - r o o t > < \/ a p p - r o o t > / ) ) {
80
- throw new Error ( 'Response does not match expected value.' ) ;
81
- }
82
- } )
83
- . then (
84
- ( ) => killAllProcesses ( ) ,
85
- ( err ) => {
86
- killAllProcesses ( ) ;
87
- throw err ;
88
- } ,
89
- )
90
- ) ;
17
+ return Promise . resolve ( )
18
+ . then ( ( ) => ngServe ( '--host=0.0.0.0' , `--public-host=${ publicHost } ` ) )
19
+ . then ( ( ) => fetch ( localAddress ) )
20
+ . then ( ( response ) => response . text ( ) )
21
+ . then ( ( body ) => {
22
+ if ( ! body . match ( / < a p p - r o o t > < \/ a p p - r o o t > / ) ) {
23
+ throw new Error ( 'Response does not match expected value.' ) ;
24
+ }
25
+ } )
26
+ . then ( ( ) => killAllProcesses ( ) )
27
+ . then ( ( ) => ngServe ( '--host=0.0.0.0' , `--disable-host-check` ) )
28
+ . then ( ( ) => fetch ( localAddress ) )
29
+ . then ( ( response ) => response . text ( ) )
30
+ . then ( ( body ) => {
31
+ if ( ! body . match ( / < a p p - r o o t > < \/ a p p - r o o t > / ) ) {
32
+ throw new Error ( 'Response does not match expected value.' ) ;
33
+ }
34
+ } )
35
+
36
+ . then ( ( ) => killAllProcesses ( ) )
37
+ . then ( ( ) => ngServe ( '--host=0.0.0.0' , `--public-host=${ localAddress } ` ) )
38
+ . then ( ( ) => fetch ( localAddress ) )
39
+ . then ( ( response ) => response . text ( ) )
40
+ . then ( ( body ) => {
41
+ if ( ! body . match ( / < a p p - r o o t > < \/ a p p - r o o t > / ) ) {
42
+ throw new Error ( 'Response does not match expected value.' ) ;
43
+ }
44
+ } )
45
+ . then ( ( ) => killAllProcesses ( ) )
46
+ . then ( ( ) => ngServe ( '--host=0.0.0.0' , `--public-host=${ firstLocalIp } ` ) )
47
+ . then ( ( ) => fetch ( localAddress ) )
48
+ . then ( ( response ) => response . text ( ) )
49
+ . then ( ( body ) => {
50
+ if ( ! body . match ( / < a p p - r o o t > < \/ a p p - r o o t > / ) ) {
51
+ throw new Error ( 'Response does not match expected value.' ) ;
52
+ }
53
+ } )
54
+ . finally ( ( ) => killAllProcesses ( ) ) ;
91
55
}
0 commit comments