From 9d36ae293c6f399842f07bccb313de4c1b36beae Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Thu, 18 Sep 2014 19:07:15 +0200 Subject: [PATCH] Run check before any assert so server is stopped --- test/support/assert.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/support/assert.js b/test/support/assert.js index 2c7e174f..97c8fce3 100644 --- a/test/support/assert.js +++ b/test/support/assert.js @@ -226,6 +226,8 @@ assert.response = function(server, req, res, msg){ response.on('end', function(){ if (timer) clearTimeout(timer); + check(); + // Assert response body if (res.body !== undefined) { var eql = res.body instanceof RegExp @@ -271,7 +273,6 @@ assert.response = function(server, req, res, msg){ // Callback callback(response); - check(); }); });