react-code-dataset / next.js /test /e2e /edge-runtime-pages-api-route /edge-runtime-pages-api-route.test.ts
Download next.js/test/e2e/edge-runtime-pages-api-route/edge-runtime-pages-api-route.test.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 506 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/edge-runtime-pages-api-route/edge-runtime-pages-api-route.test.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/e2e/edge-runtime-pages-api-route/edge-runtime-pages-api-route.test.ts
-
curl -L -o edge-runtime-pages-api-route.test.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/e2e/edge-runtime-pages-api-route/edge-runtime-pages-api-route.test.ts
506 Bytes
| import { nextTestSetup } from 'e2e-utils' | |
| describe('Edge runtime pages-api route', () => { | |
| const { next } = nextTestSetup({ | |
| files: __dirname, | |
| }) | |
| it('should work edge runtime', async () => { | |
| const res = await next.fetch('/api/edge') | |
| const text = await res.text() | |
| expect(text).toContain('All Good') | |
| }) | |
| it('should work with node runtime', async () => { | |
| const res = await next.fetch('/api/node') | |
| const text = await res.text() | |
| expect(text).toContain('All Good') | |
| }) | |
| }) | |