Download next.js/test/development/app-dir/app-routes-error/index.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/main/next.js/test/development/app-dir/app-routes-error/index.test.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/development/app-dir/app-routes-error/index.test.ts
-
curl -L -o index.test.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/development/app-dir/app-routes-error/index.test.ts
1.05 kB
| import { nextTestSetup } from 'e2e-utils' | |
| import { check } from 'next-test-utils' | |
| describe('app-dir - app routes errors', () => { | |
| const { next } = nextTestSetup({ | |
| files: __dirname, | |
| }) | |
| describe('bad lowercase exports', () => { | |
| it.each([ | |
| ['get'], | |
| ['head'], | |
| ['options'], | |
| ['post'], | |
| ['put'], | |
| ['delete'], | |
| ['patch'], | |
| ])( | |
| 'should print an error when using lowercase %p in dev', | |
| async (method: string) => { | |
| await next.fetch('/lowercase/' + method) | |
| await check(() => { | |
| expect(next.cliOutput).toContain( | |
| `Detected lowercase method '${method}' in` | |
| ) | |
| expect(next.cliOutput).toContain( | |
| `Export the uppercase '${method.toUpperCase()}' method name to fix this error.` | |
| ) | |
| expect(next.cliOutput).toMatch( | |
| /Detected lowercase method '.+' in '.+\/route\.js'\. Export the uppercase '.+' method name to fix this error\./ | |
| ) | |
| return 'yes' | |
| }, 'yes') | |
| } | |
| ) | |
| }) | |
| }) | |