Use listener for test

This commit is contained in:
Raul Ochoa 2016-09-26 18:09:50 +02:00
parent abc2f130c9
commit 1a20ca0bc3

View File

@ -11,11 +11,12 @@ describe('transaction', function() {
var server; var server;
before(function(done) { before(function(done) {
server = require('../../app/server')(); server = require('../../app/server')();
server.listen(SERVER_PORT, '127.0.0.1', done); this.listener = server.listen(SERVER_PORT, '127.0.0.1');
this.listener.on('listening', done);
}); });
after(function(done) { after(function(done) {
server.close(done); this.listener.close(done);
}); });
var sqlRequest = request.defaults({ var sqlRequest = request.defaults({