From d4f648f5ec809cf0feff75bc38160d283f483162 Mon Sep 17 00:00:00 2001 From: Albert Netymk Date: Mon, 3 Jun 2013 17:53:09 +0200 Subject: [PATCH] The number of output lines is wrong. It's fragile to use the exact number, so it's changed to match the string printed by testing script. --- test/logTest.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/test/logTest.js b/test/logTest.js index 54614ab..eb2451c 100644 --- a/test/logTest.js +++ b/test/logTest.js @@ -8,17 +8,12 @@ describe('When nodemon is run', function () { before(function (done) { var nodeProcess = spawn('node', ['nodemon.js', serverLocation]); - var linesOfOutput = 0; var doneLogging = false; nodeProcess.stdout.setEncoding('utf8'); nodeProcess.stdout.on('data', function (data) { logOutput += data; - if (data.indexOf('\n') !== -1) { - linesOfOutput++; - } - if (linesOfOutput === 3 && !doneLogging) { - doneLogging = true; + if (data.match(/^Running server.*/)) { nodeProcess.kill(); done(); }