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

Parsed body isn't available in promise result #40

Open
ikokostya opened this issue Oct 6, 2017 · 1 comment
Open

Parsed body isn't available in promise result #40

ikokostya opened this issue Oct 6, 2017 · 1 comment

Comments

@ikokostya
Copy link

Parsed body isn't available in promise result, because parsed body is passed to end(fn) callback as separated parameter

hippie/lib/hippie/client.js

Lines 385 to 388 in 34e0789

return new Promise(function(resolve, reject) {
self.prepare(function(err, res, body) {
if (err) return reject(err);
resolve(res);

E.g. in the following example res.body is always string:

hippie(app)
    .json()
    .get('/')
    .end()
    .then((res) => {
         assert(typeof res.body !== 'string'); 
    });
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

2 participants
@ikokostya and others