Skip to content

Commit ca9ee4e

Browse files
committed
Remove isTurbo check in custom-routes test
1 parent 11b01e0 commit ca9ee4e

File tree

1 file changed

+1
-103
lines changed

1 file changed

+1
-103
lines changed

test/integration/custom-routes/test/index.test.js

Lines changed: 1 addition & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ let buildId
3838
let appPort
3939
let app
4040

41-
const runTests = (isDev = false, isTurbo = false) => {
41+
const runTests = (isDev = false) => {
4242
it.each([
4343
{
4444
path: '/to-ANOTHER',
@@ -78,9 +78,6 @@ const runTests = (isDev = false, isTurbo = false) => {
7878
)
7979

8080
it('should successfully rewrite a WebSocket request', async () => {
81-
// TODO: remove once test failure has been fixed
82-
if (isTurbo) return
83-
8481
const messages = []
8582
const ws = await new Promise((resolve, reject) => {
8683
let socket = new WebSocket(`ws://localhost:${appPort}/to-websocket`)
@@ -104,9 +101,6 @@ const runTests = (isDev = false, isTurbo = false) => {
104101
})
105102

106103
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-
110104
const messages = []
111105
try {
112106
const ws = await new Promise((resolve, reject) => {
@@ -147,9 +141,6 @@ const runTests = (isDev = false, isTurbo = false) => {
147141
})
148142

149143
it('should handle has query encoding correctly', async () => {
150-
// TODO: remove once test failure has been fixed
151-
if (isTurbo) return
152-
153144
for (const expected of [
154145
{
155146
post: 'first',
@@ -192,9 +183,6 @@ const runTests = (isDev = false, isTurbo = false) => {
192183
})
193184

194185
it('should handle external beforeFiles rewrite correctly', async () => {
195-
// TODO: remove once test failure has been fixed
196-
if (isTurbo) return
197-
198186
const res = await fetchViaHTTP(appPort, '/overridden')
199187
const html = await res.text()
200188

@@ -213,9 +201,6 @@ const runTests = (isDev = false, isTurbo = false) => {
213201
})
214202

215203
it('should handle beforeFiles rewrite to dynamic route correctly', async () => {
216-
// TODO: remove once test failure has been fixed
217-
if (isTurbo) return
218-
219204
const res = await fetchViaHTTP(appPort, '/nfl')
220205
const html = await res.text()
221206

@@ -242,9 +227,6 @@ const runTests = (isDev = false, isTurbo = false) => {
242227
})
243228

244229
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-
248230
const res = await fetchViaHTTP(appPort, '/nfl')
249231
const html = await res.text()
250232

@@ -282,9 +264,6 @@ const runTests = (isDev = false, isTurbo = false) => {
282264
})
283265

284266
it('should resolveHref correctly navigating through history', async () => {
285-
// TODO: remove once test failure has been fixed
286-
if (isTurbo) return
287-
288267
const browser = await webdriver(appPort, '/')
289268
await browser.eval('window.beforeNav = 1')
290269

@@ -340,9 +319,6 @@ const runTests = (isDev = false, isTurbo = false) => {
340319
})
341320

342321
it('should not hang when proxy rewrite fails', async () => {
343-
// TODO: remove once test failure has been fixed
344-
if (isTurbo) return
345-
346322
const res = await fetchViaHTTP(appPort, '/to-nowhere', undefined, {
347323
timeout: 5000,
348324
})
@@ -363,9 +339,6 @@ const runTests = (isDev = false, isTurbo = false) => {
363339
})
364340

365341
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-
369342
const browser = await webdriver(
370343
appPort,
371344
'/rewriting-to-another-auto-export/first'
@@ -391,9 +364,6 @@ const runTests = (isDev = false, isTurbo = false) => {
391364
})
392365

393366
it('should handle param like headers properly', async () => {
394-
// TODO: remove once test failure has been fixed
395-
if (isTurbo) return
396-
397367
const res = await fetchViaHTTP(appPort, '/my-other-header/my-path')
398368
expect(res.headers.get('x-path')).toBe('my-path')
399369
expect(res.headers.get('somemy-path')).toBe('hi')
@@ -412,9 +382,6 @@ const runTests = (isDev = false, isTurbo = false) => {
412382
})
413383

414384
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-
418385
const res = await fetchViaHTTP(appPort, '/blog/post-321')
419386
expect(res.headers.get('x-something')).toBe('applied-everywhere')
420387

@@ -581,9 +548,6 @@ const runTests = (isDev = false, isTurbo = false) => {
581548
})
582549

583550
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-
587551
const html = await renderViaHTTP(
588552
appPort,
589553
'/catchall-rewrite/hello%20world%3Fw%3D24%26focalpoint%3Dcenter?a=b'
@@ -606,9 +570,6 @@ const runTests = (isDev = false, isTurbo = false) => {
606570
})
607571

608572
it('should have correct header for catchall rewrite', async () => {
609-
// TODO: remove once test failure has been fixed
610-
if (isTurbo) return
611-
612573
const res = await fetchViaHTTP(appPort, '/catchall-header/hello/world?a=b')
613574
const headerValue = res.headers.get('x-value')
614575
expect(headerValue).toBe('hello/world')
@@ -634,9 +595,6 @@ const runTests = (isDev = false, isTurbo = false) => {
634595
})
635596

636597
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-
640598
const res = await fetchViaHTTP(
641599
appPort,
642600
'/query-redirect/hello%20world%3Fw%3D24%26focalpoint%3Dcenter/world?a=b',
@@ -744,9 +702,6 @@ const runTests = (isDev = false, isTurbo = false) => {
744702
})
745703

746704
it('should work with rewrite when only specifying href', async () => {
747-
// TODO: remove once test failure has been fixed
748-
if (isTurbo) return
749-
750705
const browser = await webdriver(appPort, '/nav')
751706
await browser.eval('window.beforeNav = 1')
752707
await browser
@@ -763,9 +718,6 @@ const runTests = (isDev = false, isTurbo = false) => {
763718
})
764719

765720
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-
769721
const browser = await webdriver(appPort, '/nav')
770722
await browser.eval('window.beforeNav = 1')
771723
await browser
@@ -795,9 +747,6 @@ const runTests = (isDev = false, isTurbo = false) => {
795747
})
796748

797749
it('should match /_next file after rewrite', async () => {
798-
// TODO: remove once test failure has been fixed
799-
if (isTurbo) return
800-
801750
await renderViaHTTP(appPort, '/hello')
802751
const data = await renderViaHTTP(
803752
appPort,
@@ -816,62 +765,41 @@ const runTests = (isDev = false, isTurbo = false) => {
816765
})
817766

818767
it('should apply headers for exact match', async () => {
819-
// TODO: remove once test failure has been fixed
820-
if (isTurbo) return
821-
822768
const res = await fetchViaHTTP(appPort, '/add-header')
823769
expect(res.headers.get('x-custom-header')).toBe('hello world')
824770
expect(res.headers.get('x-another-header')).toBe('hello again')
825771
})
826772

827773
it('should apply headers for multi match', async () => {
828-
// TODO: remove once test failure has been fixed
829-
if (isTurbo) return
830-
831774
const res = await fetchViaHTTP(appPort, '/my-headers/first')
832775
expect(res.headers.get('x-first-header')).toBe('first')
833776
expect(res.headers.get('x-second-header')).toBe('second')
834777
})
835778

836779
it('should apply params for header key/values', async () => {
837-
// TODO: remove once test failure has been fixed
838-
if (isTurbo) return
839-
840780
const res = await fetchViaHTTP(appPort, '/my-other-header/first')
841781
expect(res.headers.get('x-path')).toBe('first')
842782
expect(res.headers.get('somefirst')).toBe('hi')
843783
})
844784

845785
it('should support URL for header key/values', async () => {
846-
// TODO: remove once test failure has been fixed
847-
if (isTurbo) return
848-
849786
const res = await fetchViaHTTP(appPort, '/without-params/url')
850787
expect(res.headers.get('x-origin')).toBe('https://example.com')
851788
})
852789

853790
it('should apply params header key/values with URL', async () => {
854-
// TODO: remove once test failure has been fixed
855-
if (isTurbo) return
856-
857791
const res = await fetchViaHTTP(appPort, '/with-params/url/first')
858792
expect(res.headers.get('x-url')).toBe('https://example.com/first')
859793
})
860794

861795
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-
865796
const res = await fetchViaHTTP(appPort, '/with-params/url2/first')
866797
expect(res.headers.get('x-url')).toBe(
867798
'https://example.com:8080?hello=first'
868799
)
869800
})
870801

871802
it('should support named pattern for header key/values', async () => {
872-
// TODO: remove once test failure has been fixed
873-
if (isTurbo) return
874-
875803
const res = await fetchViaHTTP(appPort, '/named-pattern/hello')
876804
expect(res.headers.get('x-something')).toBe('value=hello')
877805
expect(res.headers.get('path-hello')).toBe('end')
@@ -934,9 +862,6 @@ const runTests = (isDev = false, isTurbo = false) => {
934862
})
935863

936864
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-
940865
const res = await fetchViaHTTP(
941866
appPort,
942867
// Query unencoded is ?テスト=あ
@@ -976,9 +901,6 @@ const runTests = (isDev = false, isTurbo = false) => {
976901
})
977902

978903
it('should handle encoded value in the pathname correctly', async () => {
979-
// TODO: remove once test failure has been fixed
980-
if (isTurbo) return
981-
982904
const res = await fetchViaHTTP(
983905
appPort,
984906
'/redirect/me/to-about/' + encodeURI('\\google.com'),
@@ -1054,9 +976,6 @@ const runTests = (isDev = false, isTurbo = false) => {
1054976
})
1055977

1056978
it('should match missing header headers correctly', async () => {
1057-
// TODO: remove once test failure has been fixed
1058-
if (isTurbo) return
1059-
1060979
const res = await fetchViaHTTP(appPort, '/missing-headers-1', undefined, {
1061980
headers: {
1062981
'x-my-header': 'hello world!!',
@@ -1072,9 +991,6 @@ const runTests = (isDev = false, isTurbo = false) => {
1072991
})
1073992

1074993
it('should match missing query headers correctly', async () => {
1075-
// TODO: remove once test failure has been fixed
1076-
if (isTurbo) return
1077-
1078994
const res = await fetchViaHTTP(appPort, '/missing-headers-2', {
1079995
'my-query': 'hellooo',
1080996
})
@@ -1088,9 +1004,6 @@ const runTests = (isDev = false, isTurbo = false) => {
10881004
})
10891005

10901006
it('should match missing cookie headers correctly', async () => {
1091-
// TODO: remove once test failure has been fixed
1092-
if (isTurbo) return
1093-
10941007
const res = await fetchViaHTTP(appPort, '/missing-headers-3', undefined, {
10951008
headers: {
10961009
cookie: 'loggedIn=true',
@@ -1327,9 +1240,6 @@ const runTests = (isDev = false, isTurbo = false) => {
13271240
})
13281241

13291242
it('should match has rewrite correctly before files', async () => {
1330-
// TODO: remove once test failure has been fixed
1331-
if (isTurbo) return
1332-
13331243
const res1 = await fetchViaHTTP(appPort, '/hello')
13341244
expect(res1.status).toBe(200)
13351245
const $1 = cheerio.load(await res1.text())
@@ -1497,9 +1407,6 @@ const runTests = (isDev = false, isTurbo = false) => {
14971407
})
14981408

14991409
it('should match has header for header correctly', async () => {
1500-
// TODO: remove once test failure has been fixed
1501-
if (isTurbo) return
1502-
15031410
const res = await fetchViaHTTP(appPort, '/has-header-1', undefined, {
15041411
headers: {
15051412
'x-my-header': 'hello world!!',
@@ -1516,9 +1423,6 @@ const runTests = (isDev = false, isTurbo = false) => {
15161423
})
15171424

15181425
it('should match has query for header correctly', async () => {
1519-
// TODO: remove once test failure has been fixed
1520-
if (isTurbo) return
1521-
15221426
const res = await fetchViaHTTP(
15231427
appPort,
15241428
'/has-header-2',
@@ -1539,9 +1443,6 @@ const runTests = (isDev = false, isTurbo = false) => {
15391443
})
15401444

15411445
it('should match has cookie for header correctly', async () => {
1542-
// TODO: remove once test failure has been fixed
1543-
if (isTurbo) return
1544-
15451446
const res = await fetchViaHTTP(appPort, '/has-header-3', undefined, {
15461447
headers: {
15471448
cookie: 'loggedIn=true',
@@ -1558,9 +1459,6 @@ const runTests = (isDev = false, isTurbo = false) => {
15581459
})
15591460

15601461
it('should match has host for header correctly', async () => {
1561-
// TODO: remove once test failure has been fixed
1562-
if (isTurbo) return
1563-
15641462
const res = await fetchViaHTTP(appPort, '/has-header-4', undefined, {
15651463
headers: {
15661464
host: 'example.com',

0 commit comments

Comments
 (0)