I am complete newbie to JS world. I am trying to write a test case that tests user\'s actions on a site. I am using request-promise module to test the asyn calls. I could n
Tsalikidis answer is correct. As for:
Also, can anyone please confirm, how do we know what promise returns when it is successful, is it a single value that it resolves to or all the parameters that the async function returns
A promise (Promise/A+ compliant) always return one single value. Of course this value can be a deeply nested object with tons of information in it. But .then(function(response,body){
is inherently wrong.
A library that sends back a promise should document the format of the returned object.