@@ -11,7 +11,6 @@ const { test } = require("../helpers/playwright-test");
11
11
const { expect } = require ( "../helpers/playwright-custom-expects" ) ;
12
12
const Server = require ( "../../lib/Server" ) ;
13
13
const config = require ( "../fixtures/static-config/webpack.config" ) ;
14
- const { skipTestOnWindows } = require ( "../helpers/conditional-test" ) ;
15
14
const customHTTP = require ( "../helpers/custom-http" ) ;
16
15
const normalizeOptions = require ( "../helpers/normalize-options" ) ;
17
16
const port = require ( "../ports-map" ) [ "server-option" ] ;
@@ -82,7 +81,9 @@ test.describe("server option", () => {
82
81
83
82
await expect ( page ) . toHaveScreenshot ( ) ;
84
83
85
- expect ( consoleMessages . map ( ( message ) => message . text ( ) ) ) . toMatchSnapshotWithArray ( "console messages" ) ;
84
+ expect (
85
+ consoleMessages . map ( ( message ) => message . text ( ) ) ,
86
+ ) . toMatchSnapshotWithArray ( "console messages" ) ;
86
87
87
88
expect ( pageErrors ) . toMatchSnapshotWithArray ( "page errors" ) ;
88
89
} ) ;
@@ -138,7 +139,7 @@ test.describe("server option", () => {
138
139
await expect ( page ) . toHaveScreenshot ( ) ;
139
140
140
141
expect (
141
- consoleMessages . map ( ( message ) => message . text ( ) )
142
+ consoleMessages . map ( ( message ) => message . text ( ) ) ,
142
143
) . toMatchSnapshotWithArray ( "console messages" ) ;
143
144
144
145
expect ( pageErrors ) . toMatchSnapshotWithArray ( "page errors" ) ;
@@ -194,7 +195,9 @@ test.describe("server option", () => {
194
195
195
196
await expect ( page ) . toHaveScreenshot ( ) ;
196
197
197
- expect ( consoleMessages . map ( ( message ) => message . text ( ) ) ) . toMatchSnapshotWithArray ( "console messages" ) ;
198
+ expect (
199
+ consoleMessages . map ( ( message ) => message . text ( ) ) ,
200
+ ) . toMatchSnapshotWithArray ( "console messages" ) ;
198
201
199
202
expect ( pageErrors ) . toMatchSnapshotWithArray ( "page errors" ) ;
200
203
} ) ;
@@ -250,7 +253,7 @@ test.describe("server option", () => {
250
253
await expect ( page ) . toHaveScreenshot ( ) ;
251
254
252
255
expect (
253
- consoleMessages . map ( ( message ) => message . text ( ) )
256
+ consoleMessages . map ( ( message ) => message . text ( ) ) ,
254
257
) . toMatchSnapshotWithArray ( "console messages" ) ;
255
258
256
259
expect ( pageErrors ) . toMatchSnapshotWithArray ( "page errors" ) ;
@@ -333,10 +336,14 @@ test.describe("server option", () => {
333
336
waitUntil : "networkidle0" ,
334
337
} ) ;
335
338
336
- expect ( normalizeOptions ( createServerSpy . getCall ( 0 ) . args [ 0 ] ) ) . toMatchSnapshotWithArray ( ) ;
339
+ expect (
340
+ normalizeOptions ( createServerSpy . getCall ( 0 ) . args [ 0 ] ) ,
341
+ ) . toMatchSnapshotWithArray ( ) ;
337
342
expect ( response . status ( ) ) . toBe ( 200 ) ;
338
343
await expect ( page ) . toHaveScreenshot ( ) ;
339
- expect ( consoleMessages . map ( ( message ) => message . text ( ) ) ) . toMatchSnapshotWithArray ( "console messages" ) ;
344
+ expect (
345
+ consoleMessages . map ( ( message ) => message . text ( ) ) ,
346
+ ) . toMatchSnapshotWithArray ( "console messages" ) ;
340
347
expect ( pageErrors ) . toMatchSnapshotWithArray ( "page errors" ) ;
341
348
} ) ;
342
349
} ) ;
@@ -413,10 +420,14 @@ test.describe("server option", () => {
413
420
waitUntil : "networkidle0" ,
414
421
} ) ;
415
422
416
- expect ( normalizeOptions ( createServerSpy . getCall ( 0 ) . args [ 0 ] ) ) . toMatchSnapshotWithArray ( ) ;
423
+ expect (
424
+ normalizeOptions ( createServerSpy . getCall ( 0 ) . args [ 0 ] ) ,
425
+ ) . toMatchSnapshotWithArray ( ) ;
417
426
expect ( response . status ( ) ) . toBe ( 200 ) ;
418
427
await expect ( page ) . toHaveScreenshot ( ) ;
419
- expect ( consoleMessages . map ( ( message ) => message . text ( ) ) ) . toMatchSnapshotWithArray ( "console messages" ) ;
428
+ expect (
429
+ consoleMessages . map ( ( message ) => message . text ( ) ) ,
430
+ ) . toMatchSnapshotWithArray ( "console messages" ) ;
420
431
expect ( pageErrors ) . toMatchSnapshotWithArray ( "page errors" ) ;
421
432
} ) ;
422
433
} ) ;
@@ -502,10 +513,14 @@ test.describe("server option", () => {
502
513
waitUntil : "networkidle0" ,
503
514
} ) ;
504
515
505
- expect ( normalizeOptions ( createServerSpy . getCall ( 0 ) . args [ 0 ] ) ) . toMatchSnapshotWithArray ( ) ;
516
+ expect (
517
+ normalizeOptions ( createServerSpy . getCall ( 0 ) . args [ 0 ] ) ,
518
+ ) . toMatchSnapshotWithArray ( ) ;
506
519
expect ( response . status ( ) ) . toBe ( 200 ) ;
507
520
await expect ( page ) . toHaveScreenshot ( ) ;
508
- expect ( consoleMessages . map ( ( message ) => message . text ( ) ) ) . toMatchSnapshotWithArray ( "console messages" ) ;
521
+ expect (
522
+ consoleMessages . map ( ( message ) => message . text ( ) ) ,
523
+ ) . toMatchSnapshotWithArray ( "console messages" ) ;
509
524
expect ( pageErrors ) . toMatchSnapshotWithArray ( "page errors" ) ;
510
525
} ) ;
511
526
} ) ;
@@ -568,10 +583,14 @@ test.describe("server option", () => {
568
583
waitUntil : "networkidle0" ,
569
584
} ) ;
570
585
571
- expect ( normalizeOptions ( createServerSpy . getCall ( 0 ) . args [ 0 ] ) ) . toMatchSnapshotWithArray ( ) ;
586
+ expect (
587
+ normalizeOptions ( createServerSpy . getCall ( 0 ) . args [ 0 ] ) ,
588
+ ) . toMatchSnapshotWithArray ( ) ;
572
589
expect ( response . status ( ) ) . toBe ( 200 ) ;
573
590
await expect ( page ) . toHaveScreenshot ( ) ;
574
- expect ( consoleMessages . map ( ( message ) => message . text ( ) ) ) . toMatchSnapshotWithArray ( "console messages" ) ;
591
+ expect (
592
+ consoleMessages . map ( ( message ) => message . text ( ) ) ,
593
+ ) . toMatchSnapshotWithArray ( "console messages" ) ;
575
594
expect ( pageErrors ) . toMatchSnapshotWithArray ( "page errors" ) ;
576
595
} ) ;
577
596
} ) ;
@@ -634,16 +653,21 @@ test.describe("server option", () => {
634
653
waitUntil : "networkidle0" ,
635
654
} ) ;
636
655
637
- expect ( normalizeOptions ( createServerSpy . getCall ( 0 ) . args [ 0 ] ) ) . toMatchSnapshotWithArray ( ) ;
656
+ expect (
657
+ normalizeOptions ( createServerSpy . getCall ( 0 ) . args [ 0 ] ) ,
658
+ ) . toMatchSnapshotWithArray ( ) ;
638
659
expect ( response . status ( ) ) . toBe ( 200 ) ;
639
660
await expect ( page ) . toHaveScreenshot ( ) ;
640
- expect ( consoleMessages . map ( ( message ) => message . text ( ) ) ) . toMatchSnapshotWithArray ( "console messages" ) ;
661
+ expect (
662
+ consoleMessages . map ( ( message ) => message . text ( ) ) ,
663
+ ) . toMatchSnapshotWithArray ( "console messages" ) ;
641
664
expect ( pageErrors ) . toMatchSnapshotWithArray ( "page errors" ) ;
642
665
} ) ;
643
666
} ) ;
644
667
645
668
test . describe ( "ca, pfx, key and cert are symlinks" , ( ) => {
646
- if ( skipTestOnWindows ( "Symlinks are not supported on Windows" ) ) {
669
+ // Skip test on Windows because symlinks are not supported
670
+ if ( process . platform === "win32" ) {
647
671
return ;
648
672
}
649
673
@@ -707,7 +731,9 @@ test.describe("server option", () => {
707
731
waitUntil : "networkidle0" ,
708
732
} ) ;
709
733
710
- expect ( normalizeOptions ( createServerSpy . getCall ( 0 ) . args [ 0 ] ) ) . toMatchSnapshotWithArray ( "normalize options" ) ;
734
+ expect (
735
+ normalizeOptions ( createServerSpy . getCall ( 0 ) . args [ 0 ] ) ,
736
+ ) . toMatchSnapshotWithArray ( "normalize options" ) ;
711
737
expect ( response . status ( ) ) . toEqual ( 200 ) ;
712
738
expect ( await response . text ( ) ) . toContain ( "Heyo" ) ;
713
739
expect ( consoleMessages . map ( ( message ) => message . text ( ) ) ) . toEqual ( [ ] ) ;
@@ -781,10 +807,14 @@ test.describe("server option", () => {
781
807
waitUntil : "networkidle0" ,
782
808
} ) ;
783
809
784
- expect ( normalizeOptions ( createServerSpy . getCall ( 0 ) . args [ 0 ] ) ) . toMatchSnapshotWithArray ( "normalize options" ) ;
810
+ expect (
811
+ normalizeOptions ( createServerSpy . getCall ( 0 ) . args [ 0 ] ) ,
812
+ ) . toMatchSnapshotWithArray ( "normalize options" ) ;
785
813
expect ( response . status ( ) ) . toBe ( 200 ) ;
786
814
await expect ( page ) . toHaveScreenshot ( ) ;
787
- expect ( consoleMessages . map ( ( message ) => message . text ( ) ) ) . toMatchSnapshotWithArray ( "console messages" ) ;
815
+ expect (
816
+ consoleMessages . map ( ( message ) => message . text ( ) ) ,
817
+ ) . toMatchSnapshotWithArray ( "console messages" ) ;
788
818
expect ( pageErrors ) . toMatchSnapshotWithArray ( "page errors" ) ;
789
819
} ) ;
790
820
} ) ;
@@ -862,10 +892,14 @@ test.describe("server option", () => {
862
892
waitUntil : "networkidle0" ,
863
893
} ) ;
864
894
865
- expect ( normalizeOptions ( createServerSpy . getCall ( 0 ) . args [ 0 ] ) ) . toMatchSnapshotWithArray ( "normalize options" ) ;
895
+ expect (
896
+ normalizeOptions ( createServerSpy . getCall ( 0 ) . args [ 0 ] ) ,
897
+ ) . toMatchSnapshotWithArray ( "normalize options" ) ;
866
898
expect ( response . status ( ) ) . toBe ( 200 ) ;
867
899
await expect ( page ) . toHaveScreenshot ( ) ;
868
- expect ( consoleMessages . map ( ( message ) => message . text ( ) ) ) . toMatchSnapshotWithArray ( "console messages" ) ;
900
+ expect (
901
+ consoleMessages . map ( ( message ) => message . text ( ) ) ,
902
+ ) . toMatchSnapshotWithArray ( "console messages" ) ;
869
903
expect ( pageErrors ) . toMatchSnapshotWithArray ( "page errors" ) ;
870
904
} ) ;
871
905
} ) ;
@@ -949,11 +983,12 @@ test.describe("server option", () => {
949
983
} ) ;
950
984
951
985
expect (
952
- normalizeOptions ( createServerSpy . getCall ( 0 ) . args [ 0 ] ) ) . toMatchSnapshotWithArray ( "normalize options" ) ;
986
+ normalizeOptions ( createServerSpy . getCall ( 0 ) . args [ 0 ] ) ,
987
+ ) . toMatchSnapshotWithArray ( "normalize options" ) ;
953
988
expect ( response . status ( ) ) . toBe ( 200 ) ;
954
989
await expect ( page ) . toHaveScreenshot ( ) ;
955
990
expect (
956
- consoleMessages . map ( ( message ) => message . text ( ) )
991
+ consoleMessages . map ( ( message ) => message . text ( ) ) ,
957
992
) . toMatchSnapshotWithArray ( "console messages" ) ;
958
993
expect ( pageErrors ) . toMatchSnapshotWithArray ( "page errors" ) ;
959
994
} ) ;
@@ -1026,12 +1061,12 @@ test.describe("server option", () => {
1026
1061
} ) ;
1027
1062
1028
1063
expect (
1029
- normalizeOptions ( createServerSpy . getCall ( 0 ) . args [ 0 ] )
1064
+ normalizeOptions ( createServerSpy . getCall ( 0 ) . args [ 0 ] ) ,
1030
1065
) . toMatchSnapshotWithArray ( "normalize options" ) ;
1031
1066
expect ( response . status ( ) ) . toBe ( 200 ) ;
1032
1067
await expect ( page ) . toHaveScreenshot ( ) ;
1033
1068
expect (
1034
- consoleMessages . map ( ( message ) => message . text ( ) )
1069
+ consoleMessages . map ( ( message ) => message . text ( ) ) ,
1035
1070
) . toMatchSnapshotWithArray ( "console messages" ) ;
1036
1071
expect ( pageErrors ) . toMatchSnapshotWithArray ( "page errors" ) ;
1037
1072
} ) ;
@@ -1088,7 +1123,9 @@ test.describe("server option", () => {
1088
1123
} ) ;
1089
1124
1090
1125
test ( "should pass options to the 'https.createServer' method" , async ( ) => {
1091
- expect ( normalizeOptions ( createServerSpy . getCall ( 0 ) . args [ 0 ] ) ) . toMatchSnapshotWithArray ( "normalize options" ) ;
1126
+ expect (
1127
+ normalizeOptions ( createServerSpy . getCall ( 0 ) . args [ 0 ] ) ,
1128
+ ) . toMatchSnapshotWithArray ( "normalize options" ) ;
1092
1129
} ) ;
1093
1130
1094
1131
test ( "should handle GET request to index route (/)" , async ( ) => {
@@ -1163,11 +1200,12 @@ test.describe("server option", () => {
1163
1200
1164
1201
expect ( HTTPVersion ) . toEqual ( "h2" ) ;
1165
1202
expect (
1166
- normalizeOptions ( createServerSpy . getCall ( 0 ) . args [ 0 ] ) ) . toMatchSnapshotWithArray ( "normalize options" ) ;
1203
+ normalizeOptions ( createServerSpy . getCall ( 0 ) . args [ 0 ] ) ,
1204
+ ) . toMatchSnapshotWithArray ( "normalize options" ) ;
1167
1205
expect ( response . status ( ) ) . toBe ( 200 ) ;
1168
1206
await expect ( page ) . toHaveScreenshot ( ) ;
1169
1207
expect (
1170
- consoleMessages . map ( ( message ) => message . text ( ) )
1208
+ consoleMessages . map ( ( message ) => message . text ( ) ) ,
1171
1209
) . toMatchSnapshotWithArray ( "console messages" ) ;
1172
1210
expect ( pageErrors ) . toMatchSnapshotWithArray ( "page errors" ) ;
1173
1211
} ) ;
@@ -1232,11 +1270,12 @@ test.describe("server option", () => {
1232
1270
1233
1271
expect ( HTTPVersion ) . toEqual ( "http/1.1" ) ;
1234
1272
expect (
1235
- normalizeOptions ( createServerSpy . getCall ( 0 ) . args [ 0 ] ) ) . toMatchSnapshotWithArray ( "normalize options" ) ;
1273
+ normalizeOptions ( createServerSpy . getCall ( 0 ) . args [ 0 ] ) ,
1274
+ ) . toMatchSnapshotWithArray ( "normalize options" ) ;
1236
1275
expect ( response . status ( ) ) . toBe ( 200 ) ;
1237
1276
await expect ( page ) . toHaveScreenshot ( ) ;
1238
1277
expect (
1239
- consoleMessages . map ( ( message ) => message . text ( ) )
1278
+ consoleMessages . map ( ( message ) => message . text ( ) ) ,
1240
1279
) . toMatchSnapshotWithArray ( "console messages" ) ;
1241
1280
expect ( pageErrors ) . toMatchSnapshotWithArray ( "page errors" ) ;
1242
1281
} ) ;
0 commit comments