Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add e2e test for function config manifest (2)
- Loading branch information
Showing
9 changed files
with
67 additions
and
6 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...rted-function-config/app/foo/bar/route.ts → ...nction-config/app/app-route-edge/route.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...ith-exported-function-config/app/route.ts → ...ed-function-config/app/app-route/route.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { NextResponse } from 'next/server' | ||
|
||
export async function GET() { | ||
return NextResponse.json({ hello: 'world' }) | ||
return NextResponse.json({ hello: 'app' }) | ||
} | ||
|
||
export const maxDuration = 5 | ||
export const maxDuration = 1 |
6 changes: 6 additions & 0 deletions
6
test/e2e/app-dir/with-exported-function-config/app/app-ssr-edge/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export default function Page() { | ||
return <p>app-edge-ssr</p> | ||
} | ||
|
||
export const runtime = 'edge' | ||
export const maxDuration = 4 |
5 changes: 5 additions & 0 deletions
5
test/e2e/app-dir/with-exported-function-config/app/app-ssr/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export default function Page() { | ||
return <p>app-ssr</p> | ||
} | ||
|
||
export const maxDuration = 3 |
11 changes: 11 additions & 0 deletions
11
test/e2e/app-dir/with-exported-function-config/app/layout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export default function RootLayout({ | ||
children, | ||
}: { | ||
children: React.ReactNode | ||
}) { | ||
return ( | ||
<html lang="en"> | ||
<body>{children}</body> | ||
</html> | ||
) | ||
} |
10 changes: 10 additions & 0 deletions
10
test/e2e/app-dir/with-exported-function-config/pages/api/page-route.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { NextApiResponse, NextApiRequest } from 'next' | ||
|
||
export default function handler( | ||
_req: NextApiRequest, | ||
res: NextApiResponse<{ hello: string }> | ||
) { | ||
return res.status(200).json({ hello: 'world' }) | ||
} | ||
|
||
export const maxDuration = 1 |
9 changes: 9 additions & 0 deletions
9
test/e2e/app-dir/with-exported-function-config/pages/page-ssr.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export default function Page({ data }) { | ||
;<p>hello {data}</p> | ||
} | ||
|
||
export const maxDuration = 3 | ||
|
||
export async function getServerSideProps() { | ||
return { props: { data: 'world' } } | ||
} |
5 changes: 5 additions & 0 deletions
5
test/e2e/app-dir/with-exported-function-config/pages/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export default function Page() { | ||
;<p>hello world</p> | ||
} | ||
|
||
export const maxDuration = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters