Open efegurkan opened 8 years ago
Cannot mock requests sent this way. superagent("POST", "/relative/url") .query() .send() .end()
superagent("POST", "/relative/url") .query() .send() .end()
mocking this is fine. superagent.post("relative/url") .query() .send()
superagent.post("relative/url") .query() .send()
Is there a way to mock request on constructor at the moment ?
Thanks,
I believe the answer is no. From the source code, only methods are mocked (patched), check this for loop.
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,