@@ -38,7 +38,7 @@ let buildId
38
38
let appPort
39
39
let app
40
40
41
- const runTests = ( isDev = false , isTurbo = false ) => {
41
+ const runTests = ( isDev = false ) => {
42
42
it . each ( [
43
43
{
44
44
path : '/to-ANOTHER' ,
@@ -78,9 +78,6 @@ const runTests = (isDev = false, isTurbo = false) => {
78
78
)
79
79
80
80
it ( 'should successfully rewrite a WebSocket request' , async ( ) => {
81
- // TODO: remove once test failure has been fixed
82
- if ( isTurbo ) return
83
-
84
81
const messages = [ ]
85
82
const ws = await new Promise ( ( resolve , reject ) => {
86
83
let socket = new WebSocket ( `ws://localhost:${ appPort } /to-websocket` )
@@ -104,9 +101,6 @@ const runTests = (isDev = false, isTurbo = false) => {
104
101
} )
105
102
106
103
it ( 'should successfully rewrite a WebSocket request to a page' , async ( ) => {
107
- // TODO: remove once test failure has been fixed
108
- if ( isTurbo ) return
109
-
110
104
const messages = [ ]
111
105
try {
112
106
const ws = await new Promise ( ( resolve , reject ) => {
@@ -147,9 +141,6 @@ const runTests = (isDev = false, isTurbo = false) => {
147
141
} )
148
142
149
143
it ( 'should handle has query encoding correctly' , async ( ) => {
150
- // TODO: remove once test failure has been fixed
151
- if ( isTurbo ) return
152
-
153
144
for ( const expected of [
154
145
{
155
146
post : 'first' ,
@@ -192,9 +183,6 @@ const runTests = (isDev = false, isTurbo = false) => {
192
183
} )
193
184
194
185
it ( 'should handle external beforeFiles rewrite correctly' , async ( ) => {
195
- // TODO: remove once test failure has been fixed
196
- if ( isTurbo ) return
197
-
198
186
const res = await fetchViaHTTP ( appPort , '/overridden' )
199
187
const html = await res . text ( )
200
188
@@ -213,9 +201,6 @@ const runTests = (isDev = false, isTurbo = false) => {
213
201
} )
214
202
215
203
it ( 'should handle beforeFiles rewrite to dynamic route correctly' , async ( ) => {
216
- // TODO: remove once test failure has been fixed
217
- if ( isTurbo ) return
218
-
219
204
const res = await fetchViaHTTP ( appPort , '/nfl' )
220
205
const html = await res . text ( )
221
206
@@ -242,9 +227,6 @@ const runTests = (isDev = false, isTurbo = false) => {
242
227
} )
243
228
244
229
it ( 'should handle beforeFiles rewrite to partly dynamic route correctly' , async ( ) => {
245
- // TODO: remove once test failure has been fixed
246
- if ( isTurbo ) return
247
-
248
230
const res = await fetchViaHTTP ( appPort , '/nfl' )
249
231
const html = await res . text ( )
250
232
@@ -282,9 +264,6 @@ const runTests = (isDev = false, isTurbo = false) => {
282
264
} )
283
265
284
266
it ( 'should resolveHref correctly navigating through history' , async ( ) => {
285
- // TODO: remove once test failure has been fixed
286
- if ( isTurbo ) return
287
-
288
267
const browser = await webdriver ( appPort , '/' )
289
268
await browser . eval ( 'window.beforeNav = 1' )
290
269
@@ -340,9 +319,6 @@ const runTests = (isDev = false, isTurbo = false) => {
340
319
} )
341
320
342
321
it ( 'should not hang when proxy rewrite fails' , async ( ) => {
343
- // TODO: remove once test failure has been fixed
344
- if ( isTurbo ) return
345
-
346
322
const res = await fetchViaHTTP ( appPort , '/to-nowhere' , undefined , {
347
323
timeout : 5000 ,
348
324
} )
@@ -363,9 +339,6 @@ const runTests = (isDev = false, isTurbo = false) => {
363
339
} )
364
340
365
341
it ( 'should provide params correctly for rewrite to auto-export non-dynamic page' , async ( ) => {
366
- // TODO: remove once test failure has been fixed
367
- if ( isTurbo ) return
368
-
369
342
const browser = await webdriver (
370
343
appPort ,
371
344
'/rewriting-to-another-auto-export/first'
@@ -391,9 +364,6 @@ const runTests = (isDev = false, isTurbo = false) => {
391
364
} )
392
365
393
366
it ( 'should handle param like headers properly' , async ( ) => {
394
- // TODO: remove once test failure has been fixed
395
- if ( isTurbo ) return
396
-
397
367
const res = await fetchViaHTTP ( appPort , '/my-other-header/my-path' )
398
368
expect ( res . headers . get ( 'x-path' ) ) . toBe ( 'my-path' )
399
369
expect ( res . headers . get ( 'somemy-path' ) ) . toBe ( 'hi' )
@@ -412,9 +382,6 @@ const runTests = (isDev = false, isTurbo = false) => {
412
382
} )
413
383
414
384
it ( 'should not match dynamic route immediately after applying header' , async ( ) => {
415
- // TODO: remove once test failure has been fixed
416
- if ( isTurbo ) return
417
-
418
385
const res = await fetchViaHTTP ( appPort , '/blog/post-321' )
419
386
expect ( res . headers . get ( 'x-something' ) ) . toBe ( 'applied-everywhere' )
420
387
@@ -581,9 +548,6 @@ const runTests = (isDev = false, isTurbo = false) => {
581
548
} )
582
549
583
550
it ( 'should have correct encoding for params with catchall rewrite' , async ( ) => {
584
- // TODO: remove once test failure has been fixed
585
- if ( isTurbo ) return
586
-
587
551
const html = await renderViaHTTP (
588
552
appPort ,
589
553
'/catchall-rewrite/hello%20world%3Fw%3D24%26focalpoint%3Dcenter?a=b'
@@ -606,9 +570,6 @@ const runTests = (isDev = false, isTurbo = false) => {
606
570
} )
607
571
608
572
it ( 'should have correct header for catchall rewrite' , async ( ) => {
609
- // TODO: remove once test failure has been fixed
610
- if ( isTurbo ) return
611
-
612
573
const res = await fetchViaHTTP ( appPort , '/catchall-header/hello/world?a=b' )
613
574
const headerValue = res . headers . get ( 'x-value' )
614
575
expect ( headerValue ) . toBe ( 'hello/world' )
@@ -634,9 +595,6 @@ const runTests = (isDev = false, isTurbo = false) => {
634
595
} )
635
596
636
597
it ( 'should have correctly encoded params in query for redirect' , async ( ) => {
637
- // TODO: remove once test failure has been fixed
638
- if ( isTurbo ) return
639
-
640
598
const res = await fetchViaHTTP (
641
599
appPort ,
642
600
'/query-redirect/hello%20world%3Fw%3D24%26focalpoint%3Dcenter/world?a=b' ,
@@ -744,9 +702,6 @@ const runTests = (isDev = false, isTurbo = false) => {
744
702
} )
745
703
746
704
it ( 'should work with rewrite when only specifying href' , async ( ) => {
747
- // TODO: remove once test failure has been fixed
748
- if ( isTurbo ) return
749
-
750
705
const browser = await webdriver ( appPort , '/nav' )
751
706
await browser . eval ( 'window.beforeNav = 1' )
752
707
await browser
@@ -763,9 +718,6 @@ const runTests = (isDev = false, isTurbo = false) => {
763
718
} )
764
719
765
720
it ( 'should work with rewrite when only specifying href and ends in dynamic route' , async ( ) => {
766
- // TODO: remove once test failure has been fixed
767
- if ( isTurbo ) return
768
-
769
721
const browser = await webdriver ( appPort , '/nav' )
770
722
await browser . eval ( 'window.beforeNav = 1' )
771
723
await browser
@@ -795,9 +747,6 @@ const runTests = (isDev = false, isTurbo = false) => {
795
747
} )
796
748
797
749
it ( 'should match /_next file after rewrite' , async ( ) => {
798
- // TODO: remove once test failure has been fixed
799
- if ( isTurbo ) return
800
-
801
750
await renderViaHTTP ( appPort , '/hello' )
802
751
const data = await renderViaHTTP (
803
752
appPort ,
@@ -816,62 +765,41 @@ const runTests = (isDev = false, isTurbo = false) => {
816
765
} )
817
766
818
767
it ( 'should apply headers for exact match' , async ( ) => {
819
- // TODO: remove once test failure has been fixed
820
- if ( isTurbo ) return
821
-
822
768
const res = await fetchViaHTTP ( appPort , '/add-header' )
823
769
expect ( res . headers . get ( 'x-custom-header' ) ) . toBe ( 'hello world' )
824
770
expect ( res . headers . get ( 'x-another-header' ) ) . toBe ( 'hello again' )
825
771
} )
826
772
827
773
it ( 'should apply headers for multi match' , async ( ) => {
828
- // TODO: remove once test failure has been fixed
829
- if ( isTurbo ) return
830
-
831
774
const res = await fetchViaHTTP ( appPort , '/my-headers/first' )
832
775
expect ( res . headers . get ( 'x-first-header' ) ) . toBe ( 'first' )
833
776
expect ( res . headers . get ( 'x-second-header' ) ) . toBe ( 'second' )
834
777
} )
835
778
836
779
it ( 'should apply params for header key/values' , async ( ) => {
837
- // TODO: remove once test failure has been fixed
838
- if ( isTurbo ) return
839
-
840
780
const res = await fetchViaHTTP ( appPort , '/my-other-header/first' )
841
781
expect ( res . headers . get ( 'x-path' ) ) . toBe ( 'first' )
842
782
expect ( res . headers . get ( 'somefirst' ) ) . toBe ( 'hi' )
843
783
} )
844
784
845
785
it ( 'should support URL for header key/values' , async ( ) => {
846
- // TODO: remove once test failure has been fixed
847
- if ( isTurbo ) return
848
-
849
786
const res = await fetchViaHTTP ( appPort , '/without-params/url' )
850
787
expect ( res . headers . get ( 'x-origin' ) ) . toBe ( 'https://example.com' )
851
788
} )
852
789
853
790
it ( 'should apply params header key/values with URL' , async ( ) => {
854
- // TODO: remove once test failure has been fixed
855
- if ( isTurbo ) return
856
-
857
791
const res = await fetchViaHTTP ( appPort , '/with-params/url/first' )
858
792
expect ( res . headers . get ( 'x-url' ) ) . toBe ( 'https://example.com/first' )
859
793
} )
860
794
861
795
it ( 'should apply params header key/values with URL that has port' , async ( ) => {
862
- // TODO: remove once test failure has been fixed
863
- if ( isTurbo ) return
864
-
865
796
const res = await fetchViaHTTP ( appPort , '/with-params/url2/first' )
866
797
expect ( res . headers . get ( 'x-url' ) ) . toBe (
867
798
'https://example.com:8080?hello=first'
868
799
)
869
800
} )
870
801
871
802
it ( 'should support named pattern for header key/values' , async ( ) => {
872
- // TODO: remove once test failure has been fixed
873
- if ( isTurbo ) return
874
-
875
803
const res = await fetchViaHTTP ( appPort , '/named-pattern/hello' )
876
804
expect ( res . headers . get ( 'x-something' ) ) . toBe ( 'value=hello' )
877
805
expect ( res . headers . get ( 'path-hello' ) ) . toBe ( 'end' )
@@ -934,9 +862,6 @@ const runTests = (isDev = false, isTurbo = false) => {
934
862
} )
935
863
936
864
it ( 'should have correctly encoded query in location and refresh headers' , async ( ) => {
937
- // TODO: remove once test failure has been fixed
938
- if ( isTurbo ) return
939
-
940
865
const res = await fetchViaHTTP (
941
866
appPort ,
942
867
// Query unencoded is ?テスト=あ
@@ -976,9 +901,6 @@ const runTests = (isDev = false, isTurbo = false) => {
976
901
} )
977
902
978
903
it ( 'should handle encoded value in the pathname correctly' , async ( ) => {
979
- // TODO: remove once test failure has been fixed
980
- if ( isTurbo ) return
981
-
982
904
const res = await fetchViaHTTP (
983
905
appPort ,
984
906
'/redirect/me/to-about/' + encodeURI ( '\\google.com' ) ,
@@ -1054,9 +976,6 @@ const runTests = (isDev = false, isTurbo = false) => {
1054
976
} )
1055
977
1056
978
it ( 'should match missing header headers correctly' , async ( ) => {
1057
- // TODO: remove once test failure has been fixed
1058
- if ( isTurbo ) return
1059
-
1060
979
const res = await fetchViaHTTP ( appPort , '/missing-headers-1' , undefined , {
1061
980
headers : {
1062
981
'x-my-header' : 'hello world!!' ,
@@ -1072,9 +991,6 @@ const runTests = (isDev = false, isTurbo = false) => {
1072
991
} )
1073
992
1074
993
it ( 'should match missing query headers correctly' , async ( ) => {
1075
- // TODO: remove once test failure has been fixed
1076
- if ( isTurbo ) return
1077
-
1078
994
const res = await fetchViaHTTP ( appPort , '/missing-headers-2' , {
1079
995
'my-query' : 'hellooo' ,
1080
996
} )
@@ -1088,9 +1004,6 @@ const runTests = (isDev = false, isTurbo = false) => {
1088
1004
} )
1089
1005
1090
1006
it ( 'should match missing cookie headers correctly' , async ( ) => {
1091
- // TODO: remove once test failure has been fixed
1092
- if ( isTurbo ) return
1093
-
1094
1007
const res = await fetchViaHTTP ( appPort , '/missing-headers-3' , undefined , {
1095
1008
headers : {
1096
1009
cookie : 'loggedIn=true' ,
@@ -1327,9 +1240,6 @@ const runTests = (isDev = false, isTurbo = false) => {
1327
1240
} )
1328
1241
1329
1242
it ( 'should match has rewrite correctly before files' , async ( ) => {
1330
- // TODO: remove once test failure has been fixed
1331
- if ( isTurbo ) return
1332
-
1333
1243
const res1 = await fetchViaHTTP ( appPort , '/hello' )
1334
1244
expect ( res1 . status ) . toBe ( 200 )
1335
1245
const $1 = cheerio . load ( await res1 . text ( ) )
@@ -1497,9 +1407,6 @@ const runTests = (isDev = false, isTurbo = false) => {
1497
1407
} )
1498
1408
1499
1409
it ( 'should match has header for header correctly' , async ( ) => {
1500
- // TODO: remove once test failure has been fixed
1501
- if ( isTurbo ) return
1502
-
1503
1410
const res = await fetchViaHTTP ( appPort , '/has-header-1' , undefined , {
1504
1411
headers : {
1505
1412
'x-my-header' : 'hello world!!' ,
@@ -1516,9 +1423,6 @@ const runTests = (isDev = false, isTurbo = false) => {
1516
1423
} )
1517
1424
1518
1425
it ( 'should match has query for header correctly' , async ( ) => {
1519
- // TODO: remove once test failure has been fixed
1520
- if ( isTurbo ) return
1521
-
1522
1426
const res = await fetchViaHTTP (
1523
1427
appPort ,
1524
1428
'/has-header-2' ,
@@ -1539,9 +1443,6 @@ const runTests = (isDev = false, isTurbo = false) => {
1539
1443
} )
1540
1444
1541
1445
it ( 'should match has cookie for header correctly' , async ( ) => {
1542
- // TODO: remove once test failure has been fixed
1543
- if ( isTurbo ) return
1544
-
1545
1446
const res = await fetchViaHTTP ( appPort , '/has-header-3' , undefined , {
1546
1447
headers : {
1547
1448
cookie : 'loggedIn=true' ,
@@ -1558,9 +1459,6 @@ const runTests = (isDev = false, isTurbo = false) => {
1558
1459
} )
1559
1460
1560
1461
it ( 'should match has host for header correctly' , async ( ) => {
1561
- // TODO: remove once test failure has been fixed
1562
- if ( isTurbo ) return
1563
-
1564
1462
const res = await fetchViaHTTP ( appPort , '/has-header-4' , undefined , {
1565
1463
headers : {
1566
1464
host : 'example.com' ,
0 commit comments