Download next.js/test/e2e/edge-pages-support/edge-document.test.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.1 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/edge-pages-support/edge-document.test.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/e2e/edge-pages-support/edge-document.test.ts
-
curl -L -o edge-document.test.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/edge-pages-support/edge-document.test.ts
1.1 kB
| import { nextTestSetup, FileRef } from 'e2e-utils' | |
| import { join } from 'path' | |
| // x-ref: https://github.com/vercel/next.js/issues/45189 | |
| describe('edge render - custom _document with edge runtime', () => { | |
| const { next } = nextTestSetup({ | |
| files: { | |
| 'pages/index.js': new FileRef( | |
| join(__dirname, 'app', 'pages', 'index.js') | |
| ), | |
| 'next.config.js': new FileRef(join(__dirname, 'app', 'next.config.js')), | |
| 'pages/_document.js': ` | |
| import Document, { Html, Head, Main, NextScript } from 'next/document' | |
| export default class MyDocument extends Document { | |
| render() { | |
| return ( | |
| <Html> | |
| <Head /> | |
| <body> | |
| <Main /> | |
| <NextScript /> | |
| </body> | |
| </Html> | |
| ) | |
| } | |
| } | |
| export const config = { | |
| runtime: 'experimental-edge', | |
| } | |
| `, | |
| }, | |
| }) | |
| it('should render page properly', async () => { | |
| const $ = await next.render$('/') | |
| expect($('#page').text()).toBe('/index') | |
| }) | |
| }) | |