Download react-testing-library/src/__tests__/auto-cleanup.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 329 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-testing-library/src/__tests__/auto-cleanup.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-testing-library/src/__tests__/auto-cleanup.js
-
curl -L -o auto-cleanup.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-testing-library/src/__tests__/auto-cleanup.js
329 Bytes
| import * as React from 'react' | |
| import {render} from '../' | |
| // This just verifies that by importing RTL in an | |
| // environment which supports afterEach (like jest) | |
| // we'll get automatic cleanup between tests. | |
| test('first', () => { | |
| render(<div>hi</div>) | |
| }) | |
| test('second', () => { | |
| expect(document.body).toBeEmptyDOMElement() | |
| }) | |