How to use the whatwg-fetch.Response function in whatwg-fetch

To help you get started, we’ve selected a few whatwg-fetch 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 leifoolsen / webpack2-boilerplate / test / unit / utils / request.spec.js View on Github external
const textOk = (body) => {
  const mockResponse = new Response(body, {
    status: 200,
    headers: {
      'Content-type': 'text/html; utf-8'
    }
  });
  return Promise.resolve(mockResponse);
};
github leifoolsen / webpack2-boilerplate / test / unit / utils / request.spec.js View on Github external
const jsonError = (status, statusText) => {
  const mockResponse = new Response('', {
    status: status,
    statusText: statusText,
    headers: {
      'Content-type': 'application/json',
    },
  });
  return Promise.resolve(mockResponse);
};
github leifoolsen / webpack2-boilerplate / test / unit / logger / logger.spec.js View on Github external
const jsonOk = (body) => {
  const mockResponse = new Response(JSON.stringify(body), {
    status: 200,
    headers: {
      'Content-type': 'application/json'
    }
  });
  return Promise.resolve(mockResponse);
};
github leifoolsen / webpack2-boilerplate / test / unit / utils / request.spec.js View on Github external
const jsonOk = (body) => {
  const mockResponse = new Response(JSON.stringify(body), {
    status: 200,
    headers: {
      'Content-type': 'application/json; utf-8'
    }
  });
  return Promise.resolve(mockResponse);
};

whatwg-fetch

A window.fetch polyfill.

MIT
Latest version published 4 months ago

Package Health Score

93 / 100
Full package analysis