Download next.js/test/e2e/config-promise-export/async-function.test.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 771 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/config-promise-export/async-function.test.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/e2e/config-promise-export/async-function.test.ts
-
curl -L -o async-function.test.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/config-promise-export/async-function.test.ts
771 Bytes
| import { createNext } from 'e2e-utils' | |
| import { NextInstance } from 'e2e-utils' | |
| import { renderViaHTTP } from 'next-test-utils' | |
| describe('async export', () => { | |
| let next: NextInstance | |
| beforeAll(async () => { | |
| next = await createNext({ | |
| files: { | |
| 'pages/index.js': ` | |
| export default function Page() { | |
| return <p>hello world</p> | |
| } | |
| `, | |
| 'next.config.js': ` | |
| module.exports = async () => { | |
| return { | |
| basePath: '/docs' | |
| } | |
| } | |
| `, | |
| }, | |
| dependencies: {}, | |
| }) | |
| }) | |
| afterAll(() => next.destroy()) | |
| it('should work', async () => { | |
| const html = await renderViaHTTP(next.url, '/docs') | |
| expect(html).toContain('hello world') | |
| }) | |
| }) | |