react-code-dataset / next.js /test /production /optimize-server-react /optimize-server-react.test.ts
Download next.js/test/production/optimize-server-react/optimize-server-react.test.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 586 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/production/optimize-server-react/optimize-server-react.test.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/production/optimize-server-react/optimize-server-react.test.ts
-
curl -L -o optimize-server-react.test.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/production/optimize-server-react/optimize-server-react.test.ts
586 Bytes
| import { nextTestSetup } from 'e2e-utils' | |
| ;(process.env.IS_TURBOPACK_TEST ? describe.skip : describe)( | |
| 'optimize-server-react', | |
| () => { | |
| const { next } = nextTestSetup({ | |
| files: __dirname, | |
| }) | |
| it('should work with useEffect', async () => { | |
| const browser = await next.browser('/') | |
| expect(await browser.elementByCss('p').text()).toBe('hello world') | |
| }) | |
| it('should optimize useEffect call on server side', async () => { | |
| const file = await next.readFile('.next/server/pages/index.js') | |
| expect(file).not.toContain('useEffect') | |
| }) | |
| } | |
| ) | |