Fix tests to wait for server launch test stub to finish starting
This commit is contained in:
parent
7e9eae14e4
commit
dd54c25541
|
@ -1,5 +1,5 @@
|
|||
// We don't require ass because we can't test a majority of the server reliably.
|
||||
//require('ass');
|
||||
require('../server.js');
|
||||
console.log('done');
|
||||
console.log('ready');
|
||||
process.on('SIGTERM', function() { process.exit(0); });
|
||||
|
|
2
test.js
2
test.js
|
@ -74,7 +74,7 @@ describe('the server', function() {
|
|||
server = cproc.spawn('node', ['ass-stubs/server-test.js', port]);
|
||||
var isDone = false;
|
||||
server.stdout.on('data', function(data) {
|
||||
if (!isDone) { done(); isDone = true; }
|
||||
if (data.toString().indexOf('ready') >= 0 && !isDone) { done(); isDone = true; }
|
||||
});
|
||||
server.stderr.on('data', function(data) { console.log(''+data); });
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user