mirror of
https://github.com/SrIzan10/nodemon.git
synced 2026-05-01 10:55:09 +00:00
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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user