ctimmerm / axios-mock-adapter

Axios adapter that allows to easily mock requests
MIT License
3.44k stars 241 forks source link

Allow Blob Responses #304

Closed thefat32 closed 3 years ago

thefat32 commented 3 years ago

This fixes #275, allowing to return Blob data in a response, and mocking any AxiosRespones<Blob> endpoint.

Added tests only for false-positive checking as Blob is not available in nodejs enviroment, to add missing test like

    it("returns true for Blob", function () {
      expect(isObjectOrArray(new Blob(['TEST BLOB'], { type: 'text/plain' }))).to.be.true;
    });

it would be necessary to install cross-blob lib, but I think it is out of the scope of this fix

ctimmerm commented 3 years ago

Thanks!

erykpiast commented 3 years ago

Thank you for the fix @thefat32! When may we expect the release @ctimmerm? :)

erykpiast commented 3 years ago

@ctimmerm hey, when could we hope for a version containing this MR to be published to NPM? :)