react-code-dataset / next.js /test /development /experimental-https-server /https-server.provided-key.test.ts
Download next.js/test/development/experimental-https-server/https-server.provided-key.test.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.05 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/next.js/test/development/experimental-https-server/https-server.provided-key.test.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/next.js/test/development/experimental-https-server/https-server.provided-key.test.ts
-
curl -L -o https-server.provided-key.test.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/next.js/test/development/experimental-https-server/https-server.provided-key.test.ts
1.05 kB
| import { nextTestSetup } from 'e2e-utils' | |
| import https from 'https' | |
| import { renderViaHTTP, shouldRunTurboDevTest } from 'next-test-utils' | |
| describe('experimental-https-server (provided certificate)', () => { | |
| const { next } = nextTestSetup({ | |
| files: __dirname, | |
| startCommand: `pnpm next ${ | |
| shouldRunTurboDevTest() ? 'dev --turbo' : 'dev' | |
| } --experimental-https --experimental-https-key ./certificates/localhost-key.pem --experimental-https-cert ./certificates/localhost.pem`, | |
| }) | |
| const agent = new https.Agent({ | |
| rejectUnauthorized: false, | |
| }) | |
| it('should successfully load the app in app dir', async () => { | |
| expect(next.url).toInclude('https://') | |
| const html = await renderViaHTTP(next.url, '/1', undefined, { agent }) | |
| expect(html).toContain('Hello from App') | |
| }) | |
| it('should successfully load the app in pages dir', async () => { | |
| expect(next.url).toInclude('https://') | |
| const html = await renderViaHTTP(next.url, '/2', undefined, { agent }) | |
| expect(html).toContain('Hello from Pages') | |
| }) | |
| }) | |