react-code-dataset / wp-calypso /test /server /setup-test-framework.js
Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
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,
} ) );