Download wp-calypso/test/server/setup-test-framework.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 532 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/wp-calypso/test/server/setup-test-framework.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/wp-calypso/test/server/setup-test-framework.js
-
curl -L -o setup-test-framework.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/wp-calypso/test/server/setup-test-framework.js
532 Bytes
| import * as nock from 'nock'; | |
| // Disables all network requests for all tests. | |
| nock.disableNetConnect(); | |
| beforeAll( () => { | |
| // reactivate nock on test start | |
| if ( ! nock.isActive() ) { | |
| nock.activate(); | |
| } | |
| } ); | |
| afterAll( () => { | |
| // helps clean up nock after each test run and avoid memory leaks | |
| nock.restore(); | |
| nock.cleanAll(); | |
| } ); | |
| // Don't need to mock specific functions for any tests, but mocking | |
| // module because it accesses the `document` global. | |
| jest.mock( 'wpcom-proxy-request', () => ( { | |
| __esModule: true, | |
| } ) ); | |