How to use the jest-mock-axios.getReqByUrl function in jest-mock-axios

To help you get started, weā€™ve selected a few jest-mock-axios 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 indico / indico / __mocks__ / axios.js View on Github external
mockAxios.mustGetReqByUrl = url => {
  const req = mockAxios.getReqByUrl(url);
  if (!req) {
    throw new Error('No request to respond to!');
  }
  return req;
};