Download next.js/test/development/acceptance/ReactRefreshModule.test.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.04 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/next.js/test/development/acceptance/ReactRefreshModule.test.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/next.js/test/development/acceptance/ReactRefreshModule.test.ts
-
curl -L -o ReactRefreshModule.test.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/next.js/test/development/acceptance/ReactRefreshModule.test.ts
1.04 kB
| import { FileRef, nextTestSetup } from 'e2e-utils' | |
| import { createSandbox } from 'development-sandbox' | |
| import path from 'path' | |
| describe('ReactRefreshModule', () => { | |
| const { next } = nextTestSetup({ | |
| files: new FileRef(path.join(__dirname, 'fixtures', 'default-template')), | |
| skipStart: true, | |
| }) | |
| it('should allow any variable names', async () => { | |
| await using sandbox = await createSandbox(next) | |
| const { session } = sandbox | |
| await session.assertNoRedbox() | |
| const variables = [ | |
| '_a', | |
| '_b', | |
| 'currentExports', | |
| 'prevExports', | |
| 'isNoLongerABoundary', | |
| ] | |
| for await (const variable of variables) { | |
| await session.patch( | |
| 'pages/index.js', | |
| `import { default as ${variable} } from 'next/link' | |
| console.log({ ${variable} }) | |
| export default function Page() { | |
| return null | |
| }` | |
| ) | |
| await session.assertNoRedbox() | |
| expect(next.cliOutput).not.toContain( | |
| `'${variable}' has already been declared` | |
| ) | |
| } | |
| }) | |
| }) | |