Skip to content

Commit

Permalink
Merge pull request #100 from keithamus/3.0.0
Browse files Browse the repository at this point in the history
chore: build for 3.0.0
  • Loading branch information
keithamus authored Jun 10, 2016
2 parents 3083ab1 + 4dcd072 commit 1345021
Show file tree
Hide file tree
Showing 7 changed files with 1,193 additions and 854 deletions.
40 changes: 0 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,7 @@ chai.request(app)
expect(res).to.have.status(200);
});
```

##### Caveat

Because the `end` function is passed a callback, assertions are run
asynchronously. Therefore, a mechanism must be used to notify the testing
framework that the callback has completed. Otherwise, the test will pass before
Expand Down Expand Up @@ -218,44 +216,6 @@ agent
})
```

### .then (resolveCb, rejectCb)

* **@param** _{Function}_ resolveCB
* **@cb** {Response}
* **@param** _{Function}_ rejectCB
* **@cb** {Error}

Invoke the request to to the server. The response
will be passed as a parameter to the resolveCb,
while any errors will be passed to rejectCb.

```js
chai.request(app)
.get('/')
.then(function (res) {
expect(res).to.have.status(200);
}, function (err) {
throw err;
});
```

### .catch (rejectCb)

* **@param** _{Function}_ rejectCB
* **@cb** {Error}

Invoke the request to to the server, catching any
errors with this callback. Behaves the same as
Promises.

```js
chai.request(app)
.get('/')
.catch(function (err) {
throw err;
});
```

## Assertions

The Chai HTTP module provides a number of assertions
Expand Down
Loading

0 comments on commit 1345021

Please sign in to comment.