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

Add response body as last param of callback #10

Closed
wants to merge 1 commit into from

Conversation

timoxley
Copy link

Make the response body available in assertion callback:

request(app)
.get('/')
.expect(200, function(err, res, body) {
   assert.ok(body.something.etc)
})

Just for convenience, it's the most commonly accessed property of the response (at least in my use cases) and it matches up with mikeal's request module. Also thinking this may be handy in superagent (and perhaps should be implemented there first)

@tj
Copy link
Contributor

tj commented Jul 19, 2012

-1 from me, I dont like how mikeal's thing does it similar to jQuery, IMO res.body looks better than adding another param

@fengmk2
Copy link
Contributor

fengmk2 commented Dec 3, 2012

-1, res.body or res.text work.

@timoxley
Copy link
Author

timoxley commented Dec 3, 2012

Agreed.

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

Successfully merging this pull request may close these issues.

None yet

3 participants