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(); }