assert response body multiple times#37
Merged
tj merged 1 commit intoforwardemail:masterfrom Nov 27, 2012
fengmk2:support-expect-many
Merged
assert response body multiple times#37tj merged 1 commit intoforwardemail:masterfrom fengmk2:support-expect-many
tj merged 1 commit intoforwardemail:masterfrom
fengmk2:support-expect-many
Conversation
Contributor
Author
|
Unit test all pass on my mbp. $ make test
request(app)
✔ should fire up the app on an ephemeral port
✔ should work with an active server
✔ should work with remote server
✔ should work with a https server
✔ should work with .send() etc
✔ should work when unbuffered
✔ should default redirects to 0 (69ms)
.expect(status[, fn])
✔ should assert the response status
.expect(status, body[, fn])
✔ should assert the response body and status
when the body argument is an empty string
✔ should not quietly pass on failure
.expect(body[, fn])
✔ should assert the response body
✔ should assert the response text
✔ should assert the parsed response body
✔ should support regular expressions
✔ should assert response body multiple times
.expect(field, value[, fn])
✔ should assert the header field presence
✔ should assert the header field value
✔ should assert multiple fields
✔ should support regular expressions
✔ 19 tests complete (333 ms) |
Contributor
Author
|
@visionmedia Please review this when you are free. |
Contributor
Author
|
@visionmedia Can you review this? |
tj
added a commit
that referenced
this pull request
Nov 27, 2012
assert response body multiple times
Contributor
|
we should also add a test that doesn't pass an exception, to show that it does in fact work with multiple valid assertions |
Contributor
Author
|
OK, I do that right now. |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I found out
supertestonly check body only once.Some scenes, we need to check different texts check for body.