Error: gzip: stdin: not in gzip format

I have been trying to mock the fetch API and a function that downloads files. But while mocking the function that downloads files, I am getting the following error:

Command failed with exit code 2: tar xvf joplin-plugin-rich-markdown-0.9.0.tgz

    gzip: stdin: not in gzip format
    tar: Child returned status 1
    tar: Error is not recoverable: exiting now

      at makeError (node_modules/execa/lib/error.js:59:11)
      at handlePromise (node_modules/execa/index.js:114:26)

I have tried fixing it by changing the mock tgz and making sure tgz is valid, but it's not working.
If anyone has suggestions to fix this, please let me know. Here's the PR.

I think I might have found what's causing the problem is.

It's indeed no in gzip format. It's just a tar archive

Thanks for pointing it out. When I ran file fileName.tgz command, it is indeed saying it's in data format. Need to figure out a way to get it into a tgz format or make it from existing Blob or response.