@@ -69,10 +69,14 @@ describe('Client code', () => {
69
69
page
70
70
. waitForRequest ( ( requestObj ) => requestObj . url ( ) . match ( / s o c k j s - n o d e / ) )
71
71
. then ( ( requestObj ) => {
72
- expect (
73
- requestObj . url ( ) . includes ( `http://localhost:${ port1 } /sockjs-node` )
74
- ) . toBeTruthy ( ) ;
75
- browser . close ( ) . then ( done ) ;
72
+ browser . close ( ) . then ( ( ) => {
73
+ expect (
74
+ requestObj
75
+ . url ( )
76
+ . includes ( `http://localhost:${ port1 } /sockjs-node` )
77
+ ) . toBeTruthy ( ) ;
78
+ done ( ) ;
79
+ } ) ;
76
80
} ) ;
77
81
page . goto ( `http://localhost:${ port2 } /main` ) ;
78
82
} ) ;
@@ -105,12 +109,14 @@ describe('Client complex inline script path', () => {
105
109
requestObj . url ( ) . match ( / f o o \/ t e s t \/ b a r / )
106
110
)
107
111
. then ( ( requestObj ) => {
108
- expect (
109
- requestObj
110
- . url ( )
111
- . includes ( `http://myhost.test:${ port2 } /foo/test/bar/` )
112
- ) . toBeTruthy ( ) ;
113
- browser . close ( ) . then ( done ) ;
112
+ browser . close ( ) . then ( ( ) => {
113
+ expect (
114
+ requestObj
115
+ . url ( )
116
+ . includes ( `http://myhost.test:${ port2 } /foo/test/bar/` )
117
+ ) . toBeTruthy ( ) ;
118
+ done ( ) ;
119
+ } ) ;
114
120
} ) ;
115
121
page . goto ( `http://localhost:${ port2 } /main` ) ;
116
122
} ) ;
@@ -143,12 +149,14 @@ describe('Client complex inline script path with sockPort', () => {
143
149
requestObj . url ( ) . match ( / f o o \/ t e s t \/ b a r / )
144
150
)
145
151
. then ( ( requestObj ) => {
146
- expect (
147
- requestObj
148
- . url ( )
149
- . includes ( `http://localhost:${ port3 } /foo/test/bar` )
150
- ) . toBeTruthy ( ) ;
151
- browser . close ( ) . then ( done ) ;
152
+ browser . close ( ) . then ( ( ) => {
153
+ expect (
154
+ requestObj
155
+ . url ( )
156
+ . includes ( `http://localhost:${ port3 } /foo/test/bar` )
157
+ ) . toBeTruthy ( ) ;
158
+ done ( ) ;
159
+ } ) ;
152
160
} ) ;
153
161
154
162
page . goto ( `http://localhost:${ port2 } /main` ) ;
@@ -182,10 +190,14 @@ describe('Client complex inline script path with sockPort, no sockPath', () => {
182
190
page
183
191
. waitForRequest ( ( requestObj ) => requestObj . url ( ) . match ( / s o c k j s - n o d e / ) )
184
192
. then ( ( requestObj ) => {
185
- expect (
186
- requestObj . url ( ) . includes ( `http://localhost:${ port3 } /sockjs-node` )
187
- ) . toBeTruthy ( ) ;
188
- browser . close ( ) . then ( done ) ;
193
+ browser . close ( ) . then ( ( ) => {
194
+ expect (
195
+ requestObj
196
+ . url ( )
197
+ . includes ( `http://localhost:${ port3 } /sockjs-node` )
198
+ ) . toBeTruthy ( ) ;
199
+ done ( ) ;
200
+ } ) ;
189
201
} ) ;
190
202
page . goto ( `http://localhost:${ port2 } /main` ) ;
191
203
} ) ;
@@ -215,12 +227,14 @@ describe('Client complex inline script path with sockHost', () => {
215
227
page
216
228
. waitForRequest ( ( requestObj ) => requestObj . url ( ) . match ( / s o c k j s - n o d e / ) )
217
229
. then ( ( requestObj ) => {
218
- expect (
219
- requestObj
220
- . url ( )
221
- . includes ( `http://myhost.test:${ port2 } /sockjs-node` )
222
- ) . toBeTruthy ( ) ;
223
- browser . close ( ) . then ( done ) ;
230
+ browser . close ( ) . then ( ( ) => {
231
+ expect (
232
+ requestObj
233
+ . url ( )
234
+ . includes ( `http://myhost.test:${ port2 } /sockjs-node` )
235
+ ) . toBeTruthy ( ) ;
236
+ done ( ) ;
237
+ } ) ;
224
238
} ) ;
225
239
page . goto ( `http://localhost:${ port2 } /main` ) ;
226
240
} ) ;
@@ -286,8 +300,10 @@ describe('Client console.log', () => {
286
300
res . push ( _text ) ;
287
301
} ) ;
288
302
setTimeout ( ( ) => {
289
- expect ( res ) . toMatchSnapshot ( ) ;
290
- browser . close ( ) . then ( resolve ) ;
303
+ browser . close ( ) . then ( ( ) => {
304
+ expect ( res ) . toMatchSnapshot ( ) ;
305
+ resolve ( ) ;
306
+ } ) ;
291
307
} , 1000 ) ;
292
308
} ) ;
293
309
} )
0 commit comments