Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a1d859d

Browse filesBrowse files
committed
test: remove tests that don't make sense anymore and update some other ones
1 parent 4289aa2 commit a1d859d
Copy full SHA for a1d859d

File tree

Expand file treeCollapse file tree

2 files changed

+4
-23
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+4
-23
lines changed
Open diff view settings
Collapse file

‎tests/integration/edge-handler.test.ts‎

Copy file name to clipboardExpand all lines: tests/integration/edge-handler.test.ts
+4-7Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,7 @@ describe('page router', () => {
387387
})
388388
const res = await response.json()
389389
const url = new URL(res.url, 'http://n/')
390-
expect(url.pathname).toBe('/ssr-page-2/')
391-
expect(url.searchParams.get('__nextDataReq')).toBe('1')
390+
expect(url.pathname).toBe('/_next/data/build-id/ssr-page-2.json')
392391
expect(res.headers['x-nextjs-data']).toBe('1')
393392
expect(response.headers.get('x-nextjs-rewrite')).toBe('/ssr-page-2/')
394393
expect(response.status).toBe(200)
@@ -420,7 +419,7 @@ describe('page router', () => {
420419
expect(response.status).toBe(200)
421420
})
422421

423-
test<FixtureTestContext>('should rewrite un-rewritten data requests to page route', async (ctx) => {
422+
test<FixtureTestContext>('should NOT rewrite un-rewritten data requests to page route', async (ctx) => {
424423
await createFixture('middleware-pages', ctx)
425424
await runPlugin(ctx)
426425
const origin = await LocalServer.run(async (req, res) => {
@@ -443,8 +442,7 @@ describe('page router', () => {
443442
})
444443
const res = await response.json()
445444
const url = new URL(res.url, 'http://n/')
446-
expect(url.pathname).toBe('/ssg/hello/')
447-
expect(url.searchParams.get('__nextDataReq')).toBe('1')
445+
expect(url.pathname).toBe('/_next/data/build-id/ssg/hello.json')
448446
expect(res.headers['x-nextjs-data']).toBe('1')
449447
expect(response.status).toBe(200)
450448
})
@@ -472,8 +470,7 @@ describe('page router', () => {
472470
})
473471
const res = await response.json()
474472
const url = new URL(res.url, 'http://n/')
475-
expect(url.pathname).toBe('/blog/first/')
476-
expect(url.searchParams.get('__nextDataReq')).toBe('1')
473+
expect(url.pathname).toBe('/_next/data/build-id/blog/first.json')
477474
expect(url.searchParams.get('slug')).toBe('first')
478475
expect(res.headers['x-nextjs-data']).toBe('1')
479476
expect(response.status).toBe(200)
Collapse file

‎tests/integration/page-router.test.ts‎

Copy file name to clipboardExpand all lines: tests/integration/page-router.test.ts
-16Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -95,22 +95,6 @@ test<FixtureTestContext>('Should revalidate path with On-demand Revalidation', a
9595
expect(dateCacheInitial).not.toBe(dateCacheRevalidated)
9696
})
9797

98-
test<FixtureTestContext>('Should return JSON for data req to page route', async (ctx) => {
99-
await createFixture('page-router', ctx)
100-
await runPlugin(ctx)
101-
102-
const response = await invokeFunction(ctx, {
103-
url: '/static/revalidate-manual?__nextDataReq=1',
104-
headers: { 'x-nextjs-data': '1' },
105-
})
106-
107-
expect(response.body).toMatch(/^{"pageProps":/)
108-
109-
const data = JSON.parse(response.body)
110-
111-
expect(data.pageProps.show).toBeDefined()
112-
})
113-
11498
test.skipIf(platform === 'win32')<FixtureTestContext>(
11599
'Should set permanent "netlify-cdn-cache-control" header on fully static pages"',
116100
async (ctx) => {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.