Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mocking axios-observable with Jest #19

Closed
Foetus6907 opened this issue Jan 11, 2021 · 2 comments
Closed

Mocking axios-observable with Jest #19

Foetus6907 opened this issue Jan 11, 2021 · 2 comments

Comments

@Foetus6907
Copy link

I have an issue when i try to mock axios-observable with jest.
jest.mock("axios-observable", () => Object.assign( jest.fn(), { get: jest.fn() } ));

Here's how i try to mock it.
But i got an error when executing my test saying :
'TypeError: _axiosObservable.default.get(...).pipe is not a function'
Any idea of what going wrong or any exemple of mocking exemple implementation ?

Thanks by advance,
Best Regards

@mkoert
Copy link

mkoert commented Aug 12, 2021

Is there a reason this is closed? Is there an example on how to do this correctly then?

@ItaloMedici
Copy link

Any update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants