Skip to content

assert response body multiple times#37

Merged
tj merged 1 commit intoforwardemail:masterfrom
fengmk2:support-expect-many
Nov 27, 2012
Merged

assert response body multiple times#37
tj merged 1 commit intoforwardemail:masterfrom
fengmk2:support-expect-many

Conversation

@fengmk2
Copy link
Copy Markdown
Contributor

@fengmk2 fengmk2 commented Nov 23, 2012

I found out supertest only check body only once.

Some scenes, we need to check different texts check for body.

@fengmk2
Copy link
Copy Markdown
Contributor Author

fengmk2 commented Nov 23, 2012

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)

@fengmk2
Copy link
Copy Markdown
Contributor Author

fengmk2 commented Nov 23, 2012

@visionmedia Please review this when you are free.

@fengmk2
Copy link
Copy Markdown
Contributor Author

fengmk2 commented Nov 27, 2012

@visionmedia Can you review this?

tj added a commit that referenced this pull request Nov 27, 2012
assert response body multiple times
@tj tj merged commit bd84172 into forwardemail:master Nov 27, 2012
@tj
Copy link
Copy Markdown
Contributor

tj commented Nov 27, 2012

we should also add a test that doesn't pass an exception, to show that it does in fact work with multiple valid assertions

@fengmk2
Copy link
Copy Markdown
Contributor Author

fengmk2 commented Nov 28, 2012

OK, I do that right now.

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.

2 participants