Download react-testing-library/src/__tests__/auto-cleanup-skip.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 419 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-testing-library/src/__tests__/auto-cleanup-skip.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-testing-library/src/__tests__/auto-cleanup-skip.js
-
curl -L -o auto-cleanup-skip.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-testing-library/src/__tests__/auto-cleanup-skip.js
419 Bytes
| import * as React from 'react' | |
| let render | |
| beforeAll(() => { | |
| process.env.RTL_SKIP_AUTO_CLEANUP = 'true' | |
| const rtl = require('../') | |
| render = rtl.render | |
| }) | |
| // This one verifies that if RTL_SKIP_AUTO_CLEANUP is set | |
| // then we DON'T auto-wire up the afterEach for folks | |
| test('first', () => { | |
| render(<div>hi</div>) | |
| }) | |
| test('second', () => { | |
| expect(document.body.innerHTML).toEqual('<div><div>hi</div></div>') | |
| }) | |