How to use the fetch-mock/es5/client.restore 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 elasticpath / react-pwa-reference-storefront / components / src / ProductDisplayItem / productdisplayitem.main.api.mocks.js View on Github external
export function mockProductDisplayItemMainMultiCart() {
  fetchMock.restore();
  mockCommonProductDisplayResponses(fetchMock);
  mockItemLookupPlain(fetchMock);
  mockMultiCartResponse(fetchMock);
}
github elasticpath / react-pwa-reference-storefront / components / src / ProductDisplayItem / productdisplayitem.main.api.mocks.js View on Github external
export function mockProductDisplayItemMainPlain() {
  fetchMock.restore();
  mockCommonProductDisplayResponses(fetchMock);
  mockItemLookupPlain(fetchMock);
}
github elasticpath / react-pwa-reference-storefront / components / src / ProductDisplayItem / productdisplayitem.main.api.mocks.js View on Github external
export function mockProductDisplayItemMainColorAndSize() {
  fetchMock.restore();
  mockCommonProductDisplayResponses(fetchMock);
  mockItemLookupColorAndSize(fetchMock);
  mockItemSelections(fetchMock);
}
github formio / formio.js / src / formio.spec.js View on Github external
.then(() => {
          if (test.mock) fetchMock.restore();
          done();
        })
        .catch((err) => {
github elasticpath / react-pwa-reference-storefront / components / src / ProductListLoadmore / productlistloadmore.api.mocks.js View on Github external
export function mockProductListLoadMoreFromSearchResponse() {
  fetchMock.restore();
  mockSearchResponse(fetchMock);
}
github elasticpath / react-pwa-reference-storefront / components / src / PaymentForm / paymentform.main.api.mocks.ts View on Github external
export function mockPaymentFormSuccess() {
  fetchMock.restore();
  mockLoginResponse(fetchMock);
  mockPaymentInstrumentForm(fetchMock);
  mockPaymentInstrumentFormActionSuccess(fetchMock);
}
github elasticpath / react-pwa-reference-storefront / components / src / CategoryItems / categoryitems.main.api.mocks.ts View on Github external
export default function mockCommonCategoryItemsMainResponses() {
  fetchMock.restore();
  mockLoginResponse(fetchMock);
  mockLookupForm(fetchMock);
  mockNavigationLookup(fetchMock);
}
github elasticpath / react-pwa-reference-storefront / components / src / CartCreate / cart.create.api.mocks.js View on Github external
export function mockFetchMultiCart() {
  fetchMock.restore();
  mockLoginResponse(fetchMock);
  mockMultiCartResponse(fetchMock);
}
github elasticpath / react-pwa-reference-storefront / components / src / AppHeaderNavigation / appheadernavigation.main.api.mocks.tsx View on Github external
export function mockFetchNavigationData() {
  fetchMock.restore();
  mockLoginResponse(fetchMock);
  mockMultiCartResponse(fetchMock);
}
github studentinsights / studentinsights / app / assets / javascripts / student_profile / NoteCard.story.js View on Github external
.add('all', () => {
    fetchMock.restore();
    fetchMock.get('/mocked-url-for-restricted-note-content', { text: 'DANGEROUS restricted note content' });
    return (<div>
        {testScenarios().map(scenario =&gt; (
          <div style="{{marginLeft:">
            <h3>{scenario.label}</h3>
            <hr>
            {storyRender(storyProps(scenario.propsDiff))}
          </div>
        ))}
      </div>
    );
  })
  .add('substanceOnly', () =&gt; (