Download react-testing-library/src/config.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 631 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-testing-library/src/config.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-testing-library/src/config.js
-
curl -L -o config.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-testing-library/src/config.js
631 Bytes
| import { | |
| getConfig as getConfigDTL, | |
| configure as configureDTL, | |
| } from '@testing-library/dom' | |
| let configForRTL = { | |
| reactStrictMode: false, | |
| } | |
| function getConfig() { | |
| return { | |
| ...getConfigDTL(), | |
| ...configForRTL, | |
| } | |
| } | |
| function configure(newConfig) { | |
| if (typeof newConfig === 'function') { | |
| // Pass the existing config out to the provided function | |
| // and accept a delta in return | |
| newConfig = newConfig(getConfig()) | |
| } | |
| const {reactStrictMode, ...configForDTL} = newConfig | |
| configureDTL(configForDTL) | |
| configForRTL = { | |
| ...configForRTL, | |
| reactStrictMode, | |
| } | |
| } | |
| export {getConfig, configure} | |