How to use the fetch-mock.reset function in fetch-mock

To help you get started, we’ve selected a few 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 mock-server / mockserver-ui / src / actions / index.spec.js View on Github external
afterEach(() => {
        fetchMock.reset();
        fetchMock.restore();

        // fetchMock
        //     .getOnce('/todos', { body: { todos: ['do something'] }, headers: { 'content-type': 'application/json' } });
    });
github badbatch / graphql-box / test / specs / browser / subscription / index.ts View on Github external
afterEach(async () => {
            await client.clearCache();
            if (onMainThread) fetchMock.reset();
            result = undefined;

            await client.request(
              ecom.requests.removeMutation,
              { awaitDataCached: true, variables: { productID: "402-5806" } },
            );
          });
github badbatch / graphql-box / test / specs / server / subscription / index.ts View on Github external
afterEach(async () => {
            await client.clearCache();
            fetchMock.reset();
            result = undefined;

            await client.request(
              ecom.requests.removeMutation,
              { awaitDataCached: true, variables: { productID: "402-5806" } },
            );
          });
github Azure / ms-rest-js / test / mockHttp.ts View on Github external
passThrough(_url?: string | RegExp | undefined): void {
    fetchMock.reset();
  }
github Workfront / workfront-api / test / integration / create.spec.ts View on Github external
describe('Create', function() {

    afterEach(fetchMock.reset)
    afterEach(fetchMock.restore)

    beforeEach(function() {
        this.api = new Api({
            url: API_URL
        })
    })
    afterEach(function() {
        this.api = undefined
    })

    beforeEach(function() {
        fetchMock.mock(
            `begin:${API_URL}/attask/api`,
            fixture,
            {
github Workfront / workfront-api / test / integration / get.spec.ts View on Github external
describe('Get', function() {

    afterEach(fetchMock.reset)
    afterEach(fetchMock.restore)

    beforeEach(function() {
        this.api = new Api({
            url: API_URL
        })
    })
    afterEach(function() {
        this.api = undefined
    })

    describe('Call with single objId (String)', function() {
        beforeEach(function() {
            fetchMock.mock(
                `begin:${API_URL}/attask/api`,
                getFixture,
github badbatch / graphql-box / test / specs / browser / query / index.ts View on Github external
afterEach(async () => {
            await client.clearCache();
            if (onMainThread) fetchMock.reset();
          });
github Workfront / workfront-api / test / integration / editUsingGet.spec.ts View on Github external
describe('Edit', function() {

    afterEach(fetchMock.reset)
    afterEach(fetchMock.restore)

    beforeEach(function() {
        this.api = new Api({
            url: API_URL,
            apiKey: 'testapikey',
            alwaysUseGet: true
        })
    })
    afterEach(function() {
        this.api = undefined
    })

    beforeEach(function() {
        fetchMock.mock(
            `begin:${API_URL}/attask/api`,
github apache / incubator-superset / superset / assets / spec / javascripts / explore / components / withVerification_spec.jsx View on Github external
setTimeout(() => {
      expect(fetchMock.calls(defaultProps.getEndpoint())).toHaveLength(1);
      fetchMock.reset();
    }, 0);
    wrapper.setProps({ ...props, controlValues: { metrics: 'avg__value' } });