Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update switchable runtime snapshot for Turbopack #63400

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 0 additions & 70 deletions test/e2e/switchable-runtime/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,40 +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/)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

most of the nodejs/edge routes tests are also covered in other app-dir tests already, this is a pretty legacy test that can be deleted 👍

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([
'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 @@ -613,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
5 changes: 2 additions & 3 deletions test/turbopack-tests-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6820,13 +6820,12 @@
"Switchable runtime Switchable runtime (dev) should be able to navigate between edge SSR routes without any errors",
"Switchable runtime Switchable runtime (dev) should be possible to switch between runtimes in API routes",
"Switchable runtime Switchable runtime (dev) should be possible to switch between runtimes in pages",
"Switchable runtime Switchable runtime (dev) should build /api/hello and /api/edge as an api route with edge runtime",
"Switchable runtime Switchable runtime (dev) should not consume server.js file extension",
"Switchable runtime Switchable runtime (dev) should not include edge api routes and edge ssr routes into dev middleware manifest",
"Switchable runtime Switchable runtime (dev) should sort edge SSR routes correctly"
],
"failed": [
"Switchable runtime Switchable runtime (dev) should build /api/hello and /api/edge as an api route with edge runtime"
],
"failed": [],
"pending": [
"Switchable runtime Switchable runtime (dev) should be possible to switch between runtimes with same content",
"Switchable runtime Switchable runtime (dev) should give proper errors for invalid runtime in app dir",
Expand Down
Loading