@@ -245,16 +245,15 @@ for (const webSocketServerType of webSocketServerTypes) {
245
245
} ) ;
246
246
} ) ;
247
247
248
- describe ( 'should work with custom client port and path ' , ( ) => {
248
+ describe ( 'should work with the " client.webSocketURL.protocol" option ' , ( ) => {
249
249
beforeAll ( ( done ) => {
250
250
const options = {
251
251
webSocketServer : webSocketServerType ,
252
252
port : port2 ,
253
253
host : '0.0.0.0' ,
254
254
client : {
255
255
webSocketURL : {
256
- path : '/foo/test/bar/' ,
257
- port : port3 ,
256
+ protocol : 'ws:' ,
258
257
} ,
259
258
} ,
260
259
} ;
@@ -265,11 +264,11 @@ for (const webSocketServerType of webSocketServerTypes) {
265
264
afterAll ( testServer . close ) ;
266
265
267
266
describe ( 'browser client' , ( ) => {
268
- it ( 'uses correct port and path ' , ( done ) => {
267
+ it ( 'should work ' , ( done ) => {
269
268
runBrowser ( ) . then ( ( { page, browser } ) => {
270
- waitForTest ( browser , page , / f o o \/ t e s t \/ b a r / , ( websocketUrl ) => {
269
+ waitForTest ( browser , page , / w s / , ( websocketUrl ) => {
271
270
expect ( websocketUrl ) . toContain (
272
- `${ websocketUrlProtocol } ://localhost:${ port3 } /foo/test/bar `
271
+ `${ websocketUrlProtocol } ://localhost:${ port2 } /ws `
273
272
) ;
274
273
275
274
done ( ) ;
@@ -281,15 +280,15 @@ for (const webSocketServerType of webSocketServerTypes) {
281
280
} ) ;
282
281
} ) ;
283
282
284
- describe ( 'should work with custom client port ' , ( ) => {
283
+ describe ( 'should work with the " client.webSocketURL.protocol" option using "auto:" value ' , ( ) => {
285
284
beforeAll ( ( done ) => {
286
285
const options = {
287
286
webSocketServer : webSocketServerType ,
288
287
port : port2 ,
289
288
host : '0.0.0.0' ,
290
289
client : {
291
290
webSocketURL : {
292
- port : port3 ,
291
+ protocol : 'auto:' ,
293
292
} ,
294
293
} ,
295
294
} ;
@@ -300,11 +299,11 @@ for (const webSocketServerType of webSocketServerTypes) {
300
299
afterAll ( testServer . close ) ;
301
300
302
301
describe ( 'browser client' , ( ) => {
303
- it ( 'uses correct port and path ' , ( done ) => {
302
+ it ( 'should work ' , ( done ) => {
304
303
runBrowser ( ) . then ( ( { page, browser } ) => {
305
304
waitForTest ( browser , page , / w s / , ( websocketUrl ) => {
306
305
expect ( websocketUrl ) . toContain (
307
- `${ websocketUrlProtocol } ://localhost:${ port3 } /ws`
306
+ `${ websocketUrlProtocol } ://localhost:${ port2 } /ws`
308
307
) ;
309
308
310
309
done ( ) ;
@@ -316,15 +315,15 @@ for (const webSocketServerType of webSocketServerTypes) {
316
315
} ) ;
317
316
} ) ;
318
317
319
- describe ( 'should work with custom client port as string ' , ( ) => {
318
+ describe ( 'should work with the " client.webSocketURL.protocol" option using "http:" value and covert to "ws" ' , ( ) => {
320
319
beforeAll ( ( done ) => {
321
320
const options = {
322
321
webSocketServer : webSocketServerType ,
323
322
port : port2 ,
324
323
host : '0.0.0.0' ,
325
324
client : {
326
325
webSocketURL : {
327
- port : ` ${ port3 } ` ,
326
+ protocol : 'http:' ,
328
327
} ,
329
328
} ,
330
329
} ;
@@ -335,11 +334,11 @@ for (const webSocketServerType of webSocketServerTypes) {
335
334
afterAll ( testServer . close ) ;
336
335
337
336
describe ( 'browser client' , ( ) => {
338
- it ( 'uses correct port and path ' , ( done ) => {
337
+ it ( 'should work ' , ( done ) => {
339
338
runBrowser ( ) . then ( ( { page, browser } ) => {
340
339
waitForTest ( browser , page , / w s / , ( websocketUrl ) => {
341
340
expect ( websocketUrl ) . toContain (
342
- `${ websocketUrlProtocol } ://localhost:${ port3 } /ws`
341
+ `${ websocketUrlProtocol } ://localhost:${ port2 } /ws`
343
342
) ;
344
343
345
344
done ( ) ;
@@ -351,16 +350,79 @@ for (const webSocketServerType of webSocketServerTypes) {
351
350
} ) ;
352
351
} ) ;
353
352
354
- describe ( 'should work with custom client.webSocketURL.port and webSocketServer.options.port both as string ' , ( ) => {
353
+ describe ( 'should work with the " client.webSocketURL.host" option ' , ( ) => {
355
354
beforeAll ( ( done ) => {
356
355
const options = {
357
- webSocketServer : {
358
- type : webSocketServerType ,
359
- options : {
360
- host : '0.0.0.0' ,
361
- port : `${ port2 } ` ,
356
+ webSocketServer : webSocketServerType ,
357
+ port : port2 ,
358
+ host : '0.0.0.0' ,
359
+ client : {
360
+ webSocketURL : {
361
+ host : 'myhost.test' ,
362
362
} ,
363
363
} ,
364
+ } ;
365
+ testServer . startAwaitingCompilation ( config , options , done ) ;
366
+ } ) ;
367
+
368
+ afterAll ( testServer . close ) ;
369
+
370
+ describe ( 'browser client' , ( ) => {
371
+ it ( 'should work' , ( done ) => {
372
+ runBrowser ( ) . then ( ( { page, browser } ) => {
373
+ waitForTest ( browser , page , / w s / , ( websocketUrl ) => {
374
+ expect ( websocketUrl ) . toContain (
375
+ `${ websocketUrlProtocol } ://myhost.test:${ port2 } /ws`
376
+ ) ;
377
+
378
+ done ( ) ;
379
+ } ) ;
380
+
381
+ page . goto ( `http://localhost:${ port2 } /main` ) ;
382
+ } ) ;
383
+ } ) ;
384
+ } ) ;
385
+ } ) ;
386
+
387
+ describe ( 'should work with the "client.webSocketURL.port" option' , ( ) => {
388
+ beforeAll ( ( done ) => {
389
+ const options = {
390
+ webSocketServer : webSocketServerType ,
391
+ port : port2 ,
392
+ host : '0.0.0.0' ,
393
+ client : {
394
+ webSocketURL : {
395
+ port : port3 ,
396
+ } ,
397
+ } ,
398
+ } ;
399
+
400
+ testServer . startAwaitingCompilation ( config , options , done ) ;
401
+ } ) ;
402
+
403
+ afterAll ( testServer . close ) ;
404
+
405
+ describe ( 'browser client' , ( ) => {
406
+ it ( 'should work' , ( done ) => {
407
+ runBrowser ( ) . then ( ( { page, browser } ) => {
408
+ waitForTest ( browser , page , / w s / , ( websocketUrl ) => {
409
+ expect ( websocketUrl ) . toContain (
410
+ `${ websocketUrlProtocol } ://localhost:${ port3 } /ws`
411
+ ) ;
412
+
413
+ done ( ) ;
414
+ } ) ;
415
+
416
+ page . goto ( `http://localhost:${ port2 } /main` ) ;
417
+ } ) ;
418
+ } ) ;
419
+ } ) ;
420
+ } ) ;
421
+
422
+ describe ( 'should work with the "client.webSocketURL.port" option as "string"' , ( ) => {
423
+ beforeAll ( ( done ) => {
424
+ const options = {
425
+ webSocketServer : webSocketServerType ,
364
426
port : port2 ,
365
427
host : '0.0.0.0' ,
366
428
client : {
@@ -376,7 +438,7 @@ for (const webSocketServerType of webSocketServerTypes) {
376
438
afterAll ( testServer . close ) ;
377
439
378
440
describe ( 'browser client' , ( ) => {
379
- it ( 'uses correct port and path ' , ( done ) => {
441
+ it ( 'should work ' , ( done ) => {
380
442
runBrowser ( ) . then ( ( { page, browser } ) => {
381
443
waitForTest ( browser , page , / w s / , ( websocketUrl ) => {
382
444
expect ( websocketUrl ) . toContain (
@@ -392,29 +454,72 @@ for (const webSocketServerType of webSocketServerTypes) {
392
454
} ) ;
393
455
} ) ;
394
456
395
- describe ( 'should work with custom client host ' , ( ) => {
457
+ describe ( 'should work with "client.webSocketURL.port" and " client.webSocketURL.path" options ' , ( ) => {
396
458
beforeAll ( ( done ) => {
397
459
const options = {
398
460
webSocketServer : webSocketServerType ,
399
461
port : port2 ,
400
462
host : '0.0.0.0' ,
401
463
client : {
402
464
webSocketURL : {
403
- host : 'myhost.test' ,
465
+ path : '/foo/test/bar/' ,
466
+ port : port3 ,
404
467
} ,
405
468
} ,
406
469
} ;
470
+
407
471
testServer . startAwaitingCompilation ( config , options , done ) ;
408
472
} ) ;
409
473
410
474
afterAll ( testServer . close ) ;
411
475
412
476
describe ( 'browser client' , ( ) => {
413
- it ( 'uses correct host' , ( done ) => {
477
+ it ( 'should work' , ( done ) => {
478
+ runBrowser ( ) . then ( ( { page, browser } ) => {
479
+ waitForTest ( browser , page , / f o o \/ t e s t \/ b a r / , ( websocketUrl ) => {
480
+ expect ( websocketUrl ) . toContain (
481
+ `${ websocketUrlProtocol } ://localhost:${ port3 } /foo/test/bar`
482
+ ) ;
483
+
484
+ done ( ) ;
485
+ } ) ;
486
+
487
+ page . goto ( `http://localhost:${ port2 } /main` ) ;
488
+ } ) ;
489
+ } ) ;
490
+ } ) ;
491
+ } ) ;
492
+
493
+ describe ( 'should work with "client.webSocketURL.port" and "webSocketServer.options.port" options as string' , ( ) => {
494
+ beforeAll ( ( done ) => {
495
+ const options = {
496
+ webSocketServer : {
497
+ type : webSocketServerType ,
498
+ options : {
499
+ host : '0.0.0.0' ,
500
+ port : `${ port2 } ` ,
501
+ } ,
502
+ } ,
503
+ port : port2 ,
504
+ host : '0.0.0.0' ,
505
+ client : {
506
+ webSocketURL : {
507
+ port : `${ port3 } ` ,
508
+ } ,
509
+ } ,
510
+ } ;
511
+
512
+ testServer . startAwaitingCompilation ( config , options , done ) ;
513
+ } ) ;
514
+
515
+ afterAll ( testServer . close ) ;
516
+
517
+ describe ( 'browser client' , ( ) => {
518
+ it ( 'should work' , ( done ) => {
414
519
runBrowser ( ) . then ( ( { page, browser } ) => {
415
520
waitForTest ( browser , page , / w s / , ( websocketUrl ) => {
416
521
expect ( websocketUrl ) . toContain (
417
- `${ websocketUrlProtocol } ://myhost.test :${ port2 } /ws`
522
+ `${ websocketUrlProtocol } ://localhost :${ port3 } /ws`
418
523
) ;
419
524
420
525
done ( ) ;
@@ -426,7 +531,7 @@ for (const webSocketServerType of webSocketServerTypes) {
426
531
} ) ;
427
532
} ) ;
428
533
429
- describe ( 'should work with custom client host, port, and path' , ( ) => {
534
+ describe ( 'should work with " client.webSocketURL. host", "webSocketServer.options. port" and "webSocketServer.options. path" options ' , ( ) => {
430
535
beforeAll ( ( done ) => {
431
536
const options = {
432
537
webSocketServer : webSocketServerType ,
@@ -463,7 +568,7 @@ for (const webSocketServerType of webSocketServerTypes) {
463
568
} ) ;
464
569
} ) ;
465
570
466
- describe ( 'should work with the "client.webSocketURL" option and custom client path ' , ( ) => {
571
+ describe ( 'should work with the "client.webSocketURL" option as "string" ' , ( ) => {
467
572
beforeAll ( ( done ) => {
468
573
const options = {
469
574
webSocketServer : webSocketServerType ,
@@ -480,7 +585,7 @@ for (const webSocketServerType of webSocketServerTypes) {
480
585
afterAll ( testServer . close ) ;
481
586
482
587
describe ( 'browser client' , ( ) => {
483
- it ( 'uses the correct webSocketURL hostname and path ' , ( done ) => {
588
+ it ( 'should work ' , ( done ) => {
484
589
runBrowser ( ) . then ( ( { page, browser } ) => {
485
590
waitForTest ( browser , page , / f o o \/ t e s t \/ b a r / , ( websocketUrl ) => {
486
591
expect ( websocketUrl ) . toContain (
0 commit comments