Skip to content

Commit

Permalink
Merge pull request #1327 from nylen/server-close-async
Browse files Browse the repository at this point in the history
Fix errors generating coverage reports.
  • Loading branch information
simov committed Jan 6, 2015
2 parents bd0aa25 + bd382d3 commit 3786137
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 29 deletions.
5 changes: 3 additions & 2 deletions tests/test-cookies.js
Expand Up @@ -91,6 +91,7 @@ tape('custom store', function(t) {
})

tape('cleanup', function(t) {
server.close()
t.end()
server.close(function() {
t.end()
})
})
5 changes: 3 additions & 2 deletions tests/test-follow-all-303.js
Expand Up @@ -38,6 +38,7 @@ tape('followAllRedirects with 303', function(t) {
})

tape('cleanup', function(t) {
server.close()
t.end()
server.close(function() {
t.end()
})
})
5 changes: 3 additions & 2 deletions tests/test-follow-all.js
Expand Up @@ -50,6 +50,7 @@ tape('followAllRedirects', function(t) {
})

tape('cleanup', function(t) {
server.close()
t.end()
server.close(function() {
t.end()
})
})
5 changes: 3 additions & 2 deletions tests/test-form-data.js
Expand Up @@ -97,8 +97,9 @@ function runTest(t, json) {
t.equal(err, null)
t.equal(res.statusCode, 200)
t.deepEqual(body, json ? {status: 'done'} : 'done')
server.close()
t.end()
server.close(function() {
t.end()
})
})

})
Expand Down
9 changes: 5 additions & 4 deletions tests/test-form-urlencoded.js
Expand Up @@ -27,14 +27,15 @@ function runTest (t, options) {
})
})

server.listen(8080, function() {
server.listen(6767, function() {

request.post('http://localhost:8080', options, function(err, res, body) {
request.post('http://localhost:6767', options, function(err, res, body) {
t.equal(err, null)
t.equal(res.statusCode, 200)
t.equal(body, 'done')
server.close()
t.end()
server.close(function() {
t.end()
})
})
})
}
Expand Down
5 changes: 3 additions & 2 deletions tests/test-form.js
Expand Up @@ -65,7 +65,6 @@ tape('multipart form append', function(t) {
res.end('done')

t.equal(FIELDS.length, 0)
t.end()
})
})

Expand All @@ -82,7 +81,9 @@ tape('multipart form append', function(t) {
t.equal(err, null)
t.equal(res.statusCode, 200)
t.equal(body, 'done')
server.close()
server.close(function() {
t.end()
})
})
var form = req.form()

Expand Down
5 changes: 3 additions & 2 deletions tests/test-gzip.js
Expand Up @@ -140,6 +140,7 @@ tape('transparently supports gzip error to pipes', function(t) {
})

tape('cleanup', function(t) {
server.close()
t.end()
server.close(function() {
t.end()
})
})
5 changes: 3 additions & 2 deletions tests/test-hawk.js
Expand Up @@ -48,6 +48,7 @@ tape('hawk', function(t) {
})

tape('cleanup', function(t) {
server.close()
t.end()
server.close(function() {
t.end()
})
})
5 changes: 3 additions & 2 deletions tests/test-http-signature.js
Expand Up @@ -103,6 +103,7 @@ tape('incorrect key', function(t) {
})

tape('cleanup', function(t) {
server.close()
t.end()
server.close(function() {
t.end()
})
})
8 changes: 5 additions & 3 deletions tests/test-httpModule.js
Expand Up @@ -100,7 +100,9 @@ run_tests('https only', { 'https:': faux_https })
run_tests('http and https', { 'http:': faux_http, 'https:': faux_https })

tape('cleanup', function(t) {
plain_server.close()
https_server.close()
t.end()
plain_server.close(function() {
https_server.close(function() {
t.end()
})
})
})
5 changes: 3 additions & 2 deletions tests/test-multipart.js
Expand Up @@ -107,8 +107,9 @@ function runTest(t, a) {
t.equal(err, null)
t.equal(res.statusCode, 200)
t.deepEqual(body, a.json ? {status: 'done'} : 'done')
server.close()
t.end()
server.close(function() {
t.end()
})
})

})
Expand Down
5 changes: 3 additions & 2 deletions tests/test-onelineproxy.js
Expand Up @@ -54,6 +54,7 @@ tape('chained one-line proxying', function(t) {
})

tape('cleanup', function(t) {
server.close()
t.end()
server.close(function() {
t.end()
})
})
5 changes: 3 additions & 2 deletions tests/test-rfc3986.js
Expand Up @@ -44,8 +44,9 @@ function runTest (t, options) {

request.post('http://localhost:8080', options, function(err, res, body) {
t.equal(err, null)
server.close()
t.end()
server.close(function() {
t.end()
})
})
})
}
Expand Down

0 comments on commit 3786137

Please sign in to comment.