Skip to content

Commit 1755478

Browse files
authoredNov 9, 2019
Merge pull request #572 from Xmader/fix-tests
make the tests able to run on Node 12
2 parents f42d662 + 458e97b commit 1755478

File tree

3 files changed

+41
-9
lines changed

3 files changed

+41
-9
lines changed
 

‎package-lock.json

+25-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
"devDependencies": {
8585
"common-style": "^3.0.0",
8686
"request": "^2.88.0",
87-
"vows": "~0.7.0"
87+
"vows": "~0.8.3"
8888
},
8989
"bugs": {
9090
"url": "https://github.com/nodeapps/http-server/issues"

‎test/http-server-test.js

+15
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,13 @@ vows.describe('http-server').addBatch({
125125
assert.equal(body.trim(), file.trim());
126126
}
127127
}
128+
},
129+
teardown: function (proxyServer) {
130+
proxyServer.close();
128131
}
132+
},
133+
teardown: function (server) {
134+
server.close();
129135
}
130136
},
131137
'When cors is enabled': {
@@ -156,6 +162,9 @@ vows.describe('http-server').addBatch({
156162
'response Access-Control-Allow-Headers should contain X-Test': function (err, res) {
157163
assert.ok(res.headers['access-control-allow-headers'].split(/\s*,\s*/g).indexOf('X-Test') >= 0, 204);
158164
}
165+
},
166+
teardown: function (server) {
167+
server.close();
159168
}
160169
},
161170
'When gzip and brotli compression is enabled and a compressed file is available': {
@@ -209,6 +218,9 @@ vows.describe('http-server').addBatch({
209218
assert.equal(res.statusCode, 200);
210219
assert.equal(res.headers['content-encoding'], 'br');
211220
}
221+
},
222+
teardown: function (server) {
223+
server.close();
212224
}
213225
},
214226
'When http-server is listening on 8083 with username "good_username" and password "good_password"': {
@@ -341,6 +353,9 @@ vows.describe('http-server').addBatch({
341353
assert.equal(body.trim(), file.trim());
342354
}
343355
}
356+
},
357+
teardown: function (server) {
358+
server.close();
344359
}
345360
}
346361
}).export(module);

0 commit comments

Comments
 (0)
Please sign in to comment.