Download wp-calypso/client/test-helpers/use-nock/index.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 465 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/test-helpers/use-nock/index.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/test-helpers/use-nock/index.js
-
curl -L -o index.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/test-helpers/use-nock/index.js
465 Bytes
| import debug from 'debug'; | |
| import nock from 'nock'; | |
| export { nock }; | |
| const log = debug( 'calypso:test:use-nock' ); | |
| /** | |
| * @param {Function} setupCallback Function executed before all tests are run. | |
| * @deprecated Use nock directly instead. | |
| */ | |
| export const useNock = ( setupCallback ) => { | |
| if ( setupCallback ) { | |
| beforeAll( () => setupCallback( nock ) ); | |
| } | |
| afterAll( () => { | |
| log( 'Cleaning up nock' ); | |
| nock.cleanAll(); | |
| } ); | |
| }; | |
| export default useNock; | |