Run check before any assert so server is stopped

This commit is contained in:
Raul Ochoa 2014-09-18 19:07:15 +02:00
parent 9496d83d1c
commit 9d36ae293c

View File

@ -226,6 +226,8 @@ assert.response = function(server, req, res, msg){
response.on('end', function(){ response.on('end', function(){
if (timer) clearTimeout(timer); if (timer) clearTimeout(timer);
check();
// Assert response body // Assert response body
if (res.body !== undefined) { if (res.body !== undefined) {
var eql = res.body instanceof RegExp var eql = res.body instanceof RegExp
@ -271,7 +273,6 @@ assert.response = function(server, req, res, msg){
// Callback // Callback
callback(response); callback(response);
check();
}); });
}); });