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

Cannot mock requests created with superagent constructor. #23

Open
efegurkan opened this issue Feb 1, 2016 · 2 comments
Open

Cannot mock requests created with superagent constructor. #23

efegurkan opened this issue Feb 1, 2016 · 2 comments

Comments

@efegurkan
Copy link

Cannot mock requests sent this way.
superagent("POST", "/relative/url") .query() .send() .end()

mocking this is fine.
superagent.post("relative/url") .query() .send()

Is there a way to mock request on constructor at the moment ?

Thanks,

@volodymyrbalytskyy
Copy link

I believe the answer is no.
From the source code, only methods are mocked (patched), check this for loop.

@josep687
Copy link

josep687 commented Aug 5, 2023

Image

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

3 participants