title: rn-fetch-blob: How to test upload image
body: <p>How to mock RNFetchBlob for upload image using jestjs?</p>
  
  <p><strong>Code:</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>await RNFetchBlob.fetch(
    'POST',
    'https://www.example.net/api/v1/upload-image',
    {
      Authorization: 'Bearer token',
      'Content-Type': 'application/octet-stream',
    },
    'base64string',
  )
    .then(res =&gt; res.json())
    .then(res =&gt; {
      setUrl(res.url);
    });
  </code></pre>