commit ffe5582cf09a83d255b51298470d67b222e1cd2b
Author: Tom Hughes <tom@compton.nu>
Date: Sat Nov 21 15:58:24 2015 +0000
Shutdown web server after test to avoid hang
diff --git a/test/container-test.js b/test/container-test.js
index 2fcc26a..22f2a62 100644
--- a/test/container-test.js
+++ b/test/container-test.js
@@ -72,11 +72,11 @@ vows.describe('winston/container').addBatch({
},
"the get() method": {
topic: function (container) {
- var server = http.createServer(function (req, res) {
+ this.server = http.createServer(function (req, res) {
res.end();
});
- server.listen(this.port, this.callback.bind(this, null));
+ this.server.listen(this.port, this.callback.bind(this, null));
},
"should add the logger correctly": function () {
this.someLogger = this.container.get('some-logger');
@@ -92,8 +92,10 @@ vows.describe('winston/container').addBatch({
assert.instanceOf(this.someOtherLogger.transports['webhook'], winston.transports.Webhook);
assert.strictEqual(this.someOtherLogger.transports['webhook'], this.transports[0]);
assert.strictEqual(this.someOtherLogger.transports['webhook'], this.someLogger.transports['webhook']);
+
+ this.server.close();
}
}
}
}
-}).export(module);
\ No newline at end of file
+}).export(module);