How to use the jest-fetch-mock.resetMocks function in jest-fetch-mock

To help you get started, we’ve selected a few jest-fetch-mock examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github yuriykuzin / crowdin-helper / test / commands / delete-old-branches.spec.js View on Github external
beforeEach(() => {
    jest.resetModules();
    mockedFetch.resetMocks();

    global.console = {
      ...global.console,
      log: consoleLogMock
    }

    global.process = {
      ...global.process,
      exit: processExitMock
    };

    mockedChildProcess = require('child_process');
    require('../../lib/utilities/config-manager').init();
    consoleData = '';
  });
github yuriykuzin / crowdin-helper / test / commands / upload-sources.spec.js View on Github external
beforeEach(() => {
    jest.resetModules();
    mockedFetch.resetMocks();

    global.console = {
      ...global.console,
      log: consoleLogMock
    }

    global.process = {
      ...global.process,
      exit: processExitMock
    };

    mockedChildProcess = require('child_process');
    require('../../lib/utilities/config-manager').init();
    consoleData = '';
  });
github yuriykuzin / crowdin-helper / test / commands / download-translations.spec.js View on Github external
beforeEach(() => {
    jest.resetModules();
    mockedFetch.resetMocks();

    global.console = {
      ...global.console,
      log: consoleLogMock
    }

    global.process = {
      ...global.process,
      exit: processExitMock
    };

    mockedChildProcess = require('child_process');
    require('../../lib/utilities/config-manager').init();
    consoleData = '';
  });
github yuriykuzin / crowdin-helper / test / commands / check-progress-on-branch.spec.js View on Github external
beforeEach(() => {
    jest.resetModules();
    mockedFetch.resetMocks();

    global.console = {
      ...global.console,
      log: consoleLogMock
    }

    global.process = {
      ...global.process,
      exit: processExitMock
    };

    mockedChildProcess = require('child_process');
    require('../../lib/utilities/config-manager').init();
    consoleData = '';
  });
github yuriykuzin / crowdin-helper / test / commands / trigger-auto-translation.spec.js View on Github external
beforeEach(() => {
    jest.resetModules();
    mockedFetch.resetMocks();

    global.console = {
      ...global.console,
      log: consoleLogMock
    }

    global.process = {
      ...global.process,
      exit: processExitMock
    };

    mockedChildProcess = require('child_process');
    require('../../lib/utilities/config-manager').init();
    consoleData = '';
  });
github yuriykuzin / crowdin-helper / test / utilites / crowdin-api.spec.js View on Github external
beforeEach(() => {
    fetch.resetMocks();
    fetch.mockResponseOnce(JSON.stringify(sampleResponse));
  });
github influxdata / influxdb / ui / jestSetup.ts View on Github external
afterEach(() => {
  cleanup()
  fetchMock.resetMocks()
})