Skip to content

Commit

Permalink
Update readme (#392)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajouve authored and mikelax committed Jan 30, 2017
1 parent bd63752 commit 188f8f2
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SuperTest [![Build Status](https://travis-ci.org/visionmedia/supertest.svg?branch=master)](https://travis-ci.org/visionmedia/supertest) [![npm version](https://badge.fury.io/js/supertest.svg)](https://www.npmjs.com/package/supertest) [![Dependency Status](https://david-dm.org/visionmedia/supertest.svg)](https://david-dm.org/visionmedia/supertest)
# SuperTest [![Build Status](https://travis-ci.org/visionmedia/supertest.svg?branch=master)](https://travis-ci.org/visionmedia/supertest) [![npm version](https://badge.fury.io/js/supertest.svg)](https://www.npmjs.com/package/supertest) [![Dependency Status](https://david-dm.org/visionmedia/supertest/status.svg)](https://david-dm.org/visionmedia/supertest)

HTTP assertions made easy via [superagent](http://github.com/visionmedia/superagent).

Expand Down Expand Up @@ -80,6 +80,22 @@ describe('GET /users', function() {
});
});
});
```

You can also use promises

```js
describe('GET /users', function() {
it('respond with json', function() {
return request(app)
.get('/users')
.set('Accept', 'application/json')
.expect(200)
.then(response => {
assert(response.body.email, 'foo@bar.com')
})
});
});
```

Expectations are run in the order of definition. This characteristic can be used
Expand Down

0 comments on commit 188f8f2

Please sign in to comment.