From 5d065d6039d7cc92693e2fa0f482c7c126cf5feb Mon Sep 17 00:00:00 2001 From: Lee Elenbaas Date: Wed, 14 Sep 2016 12:37:26 +0300 Subject: [PATCH] reduce lines that should never be run - fail test if they run --- test.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test.js b/test.js index 0e26243..2db3172 100644 --- a/test.js +++ b/test.js @@ -6,7 +6,7 @@ var request = require('request'); describe('http-shutdown', function(done) { it('Should shutdown with no traffic', function(done) { var server = http.createServer(function(req, res) { - res.end('OK'); + done.fail(); }).withShutdown(); server.listen(16789, function() { @@ -39,8 +39,7 @@ describe('http-shutdown', function(done) { it('Should force shutdown without waiting for outstanding traffic', function(done) { var server = http.createServer(function(req, res) { setTimeout(function() { - res.writeHead(200); - res.end('All done'); + done.fail(); }, 500); }).withShutdown();