react-code-dataset / next.js /test /production /app-dir /ppr-use-server-inserted-html /ppr-use-server-inserted-html.test.ts
Download next.js/test/production/app-dir/ppr-use-server-inserted-html/ppr-use-server-inserted-html.test.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 980 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/production/app-dir/ppr-use-server-inserted-html/ppr-use-server-inserted-html.test.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/production/app-dir/ppr-use-server-inserted-html/ppr-use-server-inserted-html.test.ts
-
curl -L -o ppr-use-server-inserted-html.test.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/production/app-dir/ppr-use-server-inserted-html/ppr-use-server-inserted-html.test.ts
980 Bytes
| import { nextTestSetup } from 'e2e-utils' | |
| describe('ppr-use-server-inserted-html', () => { | |
| const { next, isNextStart } = nextTestSetup({ | |
| files: __dirname, | |
| }) | |
| if (isNextStart) { | |
| it('should mark the route as ppr rendered', async () => { | |
| const prerenderManifest = JSON.parse( | |
| await next.readFile('.next/prerender-manifest.json') | |
| ) | |
| expect(prerenderManifest.routes['/partial-resume'].renderingMode).toBe( | |
| 'PARTIALLY_STATIC' | |
| ) | |
| }) | |
| } | |
| it('should not log insertion in build', async () => { | |
| const output = next.cliOutput | |
| expect(output).not.toContain('testing-log-insertion:') | |
| }) | |
| it('should insert the html insertion into html body', async () => { | |
| const $ = await next.render$('/partial-resume') | |
| const output = next.cliOutput | |
| expect(output).toContain('testing-log-insertion:dynamic-data') | |
| expect($('head [data-test-id]').length).toBe(0) | |
| expect($('body [data-test-id]').length).toBe(1) | |
| }) | |
| }) | |