Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,13 @@ describe('GET /users', function() {
});
});
```
Also mind:
- if you are using the `.end()` method - it closes the server, even if you initially provided it running.
- the `this` keyword in the callback passed to `.end()` is the instance of `supertest.Test` class that manages the test.

Expectations are run in the order of definition. This characteristic can be used
to modify the response body or headers before executing an assertion.


```js
describe('GET /user', function() {
Expand Down Expand Up @@ -210,6 +214,8 @@ describe('request.agent(app)', function(){
### .end(fn)

Perform the request and invoke `fn(err, res)`.
If the call was created with an instance of a server - it **closes** the server, wether it was bound to a port or not.
Also mind that the `this` context inside teh callback is set to the `supertest.Test` instance, and not the mocha test or any other context you're running in.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

teh

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a typo, inside teh callback should be inside the callback

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OMG. you're right. fixing

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well... till the next cleanup ... I guess... 😛

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

¯_(ツ)_/¯ it happens. Thanks for fixing it!


## Notes

Expand Down