Download next.js/test/unit/link-rendering.test.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 484 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/unit/link-rendering.test.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/unit/link-rendering.test.ts
-
curl -L -o link-rendering.test.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/unit/link-rendering.test.ts
484 Bytes
| /* eslint-env jest */ | |
| import React from 'react' | |
| import ReactDOM from 'react-dom/server' | |
| import Link from 'next/link' | |
| describe('Link rendering', () => { | |
| it('should render Link on its own', async () => { | |
| const element = React.createElement( | |
| Link, | |
| { | |
| href: '/my-path', | |
| }, | |
| 'to another page' | |
| ) | |
| const html = ReactDOM.renderToString(element) | |
| expect(html).toMatchInlineSnapshot( | |
| `"<a href="/my-path">to another page</a>"` | |
| ) | |
| }) | |
| }) | |