Skip to content

Commit

Permalink
Remove implementation detail
Browse files Browse the repository at this point in the history
  • Loading branch information
timneutkens committed Mar 18, 2024
1 parent 647979d commit a37c61c
Showing 1 changed file with 0 additions and 166 deletions.
166 changes: 0 additions & 166 deletions test/e2e/switchable-runtime/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,136 +179,6 @@ describe('Switchable runtime', () => {
response = await fetchViaHTTP(context.appPort, '/api/edge')
text = await response.text()
expect(text).toMatch(/Returned by Edge API Route .+\/api\/edge/)

if (!(global as any).isNextDeploy) {
const manifest = await readJson(
join(context.appDir, '.next/server/middleware-manifest.json')
)
if (process.env.TURBOPACK) {
expect(manifest).toMatchInlineSnapshot(`
{
"functions": {
"/api/edge": {
"files": [
"server/server-reference-manifest.js",
"server/middleware-build-manifest.js",
"server/middleware-react-loadable-manifest.js",
"server/next-font-manifest.js",
"server/edge/chunks/_90eaa1._.js",
"server/edge/chunks/pages_api_edge_167089.js",
"server/edge/chunks/edge-wrapper_c60acd.js",
"server/edge/chunks/edge-wrapper_4a7104.js",
],
"matchers": [
{
"locale": false,
"originalSource": "/api/edge",
"regexp": "^/api/edge(?:/)?$",
},
],
"name": "/api/edge",
"page": "/api/edge",
},
"/api/hello": {
"files": [
"server/server-reference-manifest.js",
"server/middleware-build-manifest.js",
"server/middleware-react-loadable-manifest.js",
"server/next-font-manifest.js",
"server/edge/chunks/_d84e76._.js",
"server/edge/chunks/pages_api_hello_ee733f.js",
"server/edge/chunks/edge-wrapper_181e59.js",
"server/edge/chunks/edge-wrapper_8a0dd5.js",
],
"matchers": [
{
"locale": false,
"originalSource": "/api/hello",
"regexp": "^/api/hello(?:/)?$",
},
],
"name": "/api/hello",
"page": "/api/hello",
},
},
"middleware": {},
"sortedMiddleware": [],
"version": 2,
}
`)
} else {
expect(manifest).toMatchInlineSnapshot(`
{
"functions": {
"/api/edge": {
"assets": [],
"files": [
"server/edge-runtime-webpack.js",
"server/pages/api/edge.js",
],
"matchers": [
{
"originalSource": "/api/edge",
"regexp": "^/api/edge$",
},
],
"name": "pages/api/edge",
"page": "/api/edge",
"wasm": [],
},
"/api/hello": {
"assets": [],
"files": [
"server/edge-runtime-webpack.js",
"server/pages/api/hello.js",
],
"matchers": [
{
"originalSource": "/api/hello",
"regexp": "^/api/hello$",
},
],
"name": "pages/api/hello",
"page": "/api/hello",
"wasm": [],
},
},
"middleware": {},
"sortedMiddleware": [],
"version": 2,
}
`)
}

// expect(manifest).toMatchObject({
// functions: {
// '/api/hello': {
// files: expect.arrayContaining([
// 'server/edge-runtime-webpack.js',
// 'server/pages/api/hello.js',
// ]),
// name: 'pages/api/hello',
// page: '/api/hello',
// matchers: [
// { regexp: '^/api/hello$', originalSource: '/api/hello' },
// ],
// wasm: [],
// },
// '/api/edge': {
// files: expect.arrayContaining([
// 'server/edge-runtime-webpack.js',
// 'server/pages/api/edge.js',
// ]),
// name: 'pages/api/edge',
// page: '/api/edge',
// matchers: [
// { regexp: '^/api/edge$', originalSource: '/api/edge' },
// ],
// wasm: [],
// },
// },
// })
}
})

it('should be possible to switch between runtimes in API routes', async () => {
Expand Down Expand Up @@ -709,42 +579,6 @@ describe('Switchable runtime', () => {
response = await fetchViaHTTP(context.appPort, 'rewrite/api/edge')
text = await response.text()
expect(text).toMatch(/Returned by Edge API Route .+\/api\/edge/)

if (!(global as any).isNextDeploy) {
const manifest = await readJson(
join(context.appDir, '.next/server/middleware-manifest.json')
)
expect(manifest).toMatchObject({
functions: {
'/api/hello': {
files: expect.arrayContaining([
'prerender-manifest.js',
'server/edge-runtime-webpack.js',
'server/pages/api/hello.js',
]),
name: 'pages/api/hello',
page: '/api/hello',
matchers: [
{ regexp: '^/api/hello$', originalSource: '/api/hello' },
],
wasm: [],
},
'/api/edge': {
files: expect.arrayContaining([
'prerender-manifest.js',
'server/edge-runtime-webpack.js',
'server/pages/api/edge.js',
]),
name: 'pages/api/edge',
page: '/api/edge',
matchers: [
{ regexp: '^/api/edge$', originalSource: '/api/edge' },
],
wasm: [],
},
},
})
}
})

it.skip('should display correct tree view with page types in terminal', async () => {
Expand Down

0 comments on commit a37c61c

Please sign in to comment.