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.
This commit is contained in:
Albert Netymk
2013-06-03 17:53:09 +02:00
parent eb14f0566a
commit d4f648f5ec

View File

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