From 900b25112985ea82b859064cccb8d4c2cc471a0d Mon Sep 17 00:00:00 2001 From: TJ Holowaychuk Date: Sun, 7 Oct 2012 08:06:02 -0700 Subject: [PATCH] fix example --- Readme.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Readme.md b/Readme.md index 0de3ec7b..f87f460b 100644 --- a/Readme.md +++ b/Readme.md @@ -50,7 +50,7 @@ describe('GET /users', function(){ }) ``` - If you are using the `.end()` syntax with mocha, `.expect()` assertions that fail will + If you are using the `.end()` method `.expect()` assertions that fail will not throw - they will return the assertion as an error to the `.end()` callback. In order to fail the test case, you will need to rethrow or pass `err` to `done()`, as follows: @@ -62,8 +62,7 @@ describe('GET /users', function(){ .set('Accept', 'application/json') .expect(200) .end(function(err, res){ - if (err) - return done(err) // if response is 500 or 404, test case will fail + if (err) return done(err); done() }); })