Permalink
Browse files

add mocha example

  • Loading branch information...
1 parent a3d332f commit e130fa431e4b7b57d0bece649fcc73d8debec322 @tj tj committed Jun 26, 2012
Showing with 14 additions and 0 deletions.
  1. +14 −0 Readme.md
View
@@ -37,6 +37,20 @@ request(app)
});
```
+ Here's an example with mocha, note how you can pass `done` straight to any of the `.expect()` calls:
+
+```js
+describe('GET /users', function(){
+ it('respond with json', function(done){
+ request(app)
+ .get('/user')
+ .set('Accept', 'application/json')
+ .expect('Content-Type', /json/)
+ .expect(200, done);
+ })
+})
+```
+
## API
You may use any [super-agent](http://github.com/visionmedia/superagent) methods,

0 comments on commit e130fa4

Please sign in to comment.