How to use the jest-mock-axios.mustGetReqByUrl 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 / indico / modules / events / editing / client / js / __tests__ / FileManager.spec.jsx View on Github external
await act(async () => {
      mockAxios.mockResponse(undefined, mockAxios.mustGetReqByUrl(deleteUrl));
    });
  } else {
github indico / indico / indico / modules / events / editing / client / js / __tests__ / FileManager.spec.jsx View on Github external
await act(async () => {
      fileEntry.find('FileAction').simulate('click');
      mockAxios.mockResponse(
        undefined,
        mockAxios.mustGetReqByUrl(`flask://files.delete_file/uuid=${uuid}`)
      );
    });
    expect(mockAxios.delete).toHaveBeenCalledWith(`flask://files.delete_file/uuid=${uuid}`);
github indico / indico / indico / modules / events / editing / client / js / __tests__ / FileManager.spec.jsx View on Github external
await act(async () => {
      mockAxios.mockResponse(
        {
          data: {
            uuid: 'newfile2',
            filename: file1.name,
            claimed: false,
            downloadURL: 'goes://nowhere',
          },
        },
        mockAxios.mustGetReqByUrl('http://upload/endpoint')
      );
    });
github indico / indico / indico / modules / events / editing / client / js / __tests__ / FileManager.spec.jsx View on Github external
await act(async () => {
    mockAxios.mockResponse(
      {
        data: {
          uuid,
          filename: name,
          claimed: false,
          downloadURL: 'goes://nowhere',
        },
      },
      mockAxios.mustGetReqByUrl('goes://nowhere')
    );
  });