@@ -229,80 +229,80 @@ describe('serverMode option', () => {
229
229
} ) . toThrow ( / s e r v e r M o d e m u s t b e a s t r i n g / ) ;
230
230
} ) ;
231
231
} ) ;
232
- } ) ;
233
232
234
- describe ( 'with a bad host header' , ( ) => {
235
- beforeAll ( ( done ) => {
236
- server = testServer . start (
237
- config ,
238
- {
239
- port,
240
- serverMode : class MySockJSServer extends BaseServer {
241
- constructor ( serv ) {
242
- super ( serv ) ;
243
- this . socket = sockjs . createServer ( {
244
- // Use provided up-to-date sockjs-client
245
- sockjs_url : '/__webpack_dev_server__/sockjs.bundle.js' ,
246
- // Limit useless logs
247
- log : ( severity , line ) => {
248
- if ( severity === 'error' ) {
249
- this . server . log . error ( line ) ;
250
- } else {
251
- this . server . log . debug ( line ) ;
252
- }
253
- } ,
254
- } ) ;
233
+ describe ( 'with a bad host header' , ( ) => {
234
+ beforeAll ( ( done ) => {
235
+ server = testServer . start (
236
+ config ,
237
+ {
238
+ port,
239
+ serverMode : class MySockJSServer extends BaseServer {
240
+ constructor ( serv ) {
241
+ super ( serv ) ;
242
+ this . socket = sockjs . createServer ( {
243
+ // Use provided up-to-date sockjs-client
244
+ sockjs_url : '/__webpack_dev_server__/sockjs.bundle.js' ,
245
+ // Limit useless logs
246
+ log : ( severity , line ) => {
247
+ if ( severity === 'error' ) {
248
+ this . server . log . error ( line ) ;
249
+ } else {
250
+ this . server . log . debug ( line ) ;
251
+ }
252
+ } ,
253
+ } ) ;
255
254
256
- this . socket . installHandlers ( this . server . listeningApp , {
257
- prefix : this . server . sockPath ,
258
- } ) ;
259
- }
255
+ this . socket . installHandlers ( this . server . listeningApp , {
256
+ prefix : this . server . sockPath ,
257
+ } ) ;
258
+ }
260
259
261
- send ( connection , message ) {
262
- connection . write ( message ) ;
263
- }
260
+ send ( connection , message ) {
261
+ connection . write ( message ) ;
262
+ }
264
263
265
- close ( connection ) {
266
- connection . close ( ) ;
267
- }
264
+ close ( connection ) {
265
+ connection . close ( ) ;
266
+ }
268
267
269
- onConnection ( f ) {
270
- this . socket . on ( 'connection' , ( connection ) => {
271
- f ( connection , {
272
- host : null ,
268
+ onConnection ( f ) {
269
+ this . socket . on ( 'connection' , ( connection ) => {
270
+ f ( connection , {
271
+ host : null ,
272
+ } ) ;
273
273
} ) ;
274
- } ) ;
275
- }
274
+ }
276
275
277
- onConnectionClose ( connection , f ) {
278
- connection . on ( 'close' , f ) ;
279
- }
276
+ onConnectionClose ( connection , f ) {
277
+ connection . on ( 'close' , f ) ;
278
+ }
279
+ } ,
280
280
} ,
281
- } ,
282
- done
283
- ) ;
284
- } ) ;
281
+ done
282
+ ) ;
283
+ } ) ;
285
284
286
- it ( 'results in an error' , ( done ) => {
287
- const data = [ ] ;
288
- const client = new SockJS ( `http://localhost:${ port } /sockjs-node` ) ;
285
+ it ( 'results in an error' , ( done ) => {
286
+ const data = [ ] ;
287
+ const client = new SockJS ( `http://localhost:${ port } /sockjs-node` ) ;
289
288
290
- client . onopen = ( ) => {
291
- data . push ( 'open' ) ;
292
- } ;
289
+ client . onopen = ( ) => {
290
+ data . push ( 'open' ) ;
291
+ } ;
293
292
294
- client . onmessage = ( e ) => {
295
- data . push ( e . data ) ;
296
- } ;
293
+ client . onmessage = ( e ) => {
294
+ data . push ( e . data ) ;
295
+ } ;
297
296
298
- client . onclose = ( ) => {
299
- data . push ( 'close' ) ;
300
- } ;
297
+ client . onclose = ( ) => {
298
+ data . push ( 'close' ) ;
299
+ } ;
301
300
302
- setTimeout ( ( ) => {
303
- expect ( data ) . toMatchSnapshot ( ) ;
304
- done ( ) ;
305
- } , 5000 ) ;
301
+ setTimeout ( ( ) => {
302
+ expect ( data ) . toMatchSnapshot ( ) ;
303
+ done ( ) ;
304
+ } , 5000 ) ;
305
+ } ) ;
306
306
} ) ;
307
307
} ) ;
308
308
0 commit comments