summaryrefslogtreecommitdiff
path: root/test/parallel/test-https-client-checkServerIdentity.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/parallel/test-https-client-checkServerIdentity.js')
-rw-r--r--test/parallel/test-https-client-checkServerIdentity.js15
1 files changed, 3 insertions, 12 deletions
diff --git a/test/parallel/test-https-client-checkServerIdentity.js b/test/parallel/test-https-client-checkServerIdentity.js
index 4b4bbc9d05..053a563005 100644
--- a/test/parallel/test-https-client-checkServerIdentity.js
+++ b/test/parallel/test-https-client-checkServerIdentity.js
@@ -16,14 +16,11 @@ var options = {
cert: fs.readFileSync(path.join(common.fixturesDir, 'keys/agent3-cert.pem'))
};
-var reqCount = 0;
-
-var server = https.createServer(options, function(req, res) {
- ++reqCount;
+var server = https.createServer(options, common.mustCall(function(req, res) {
res.writeHead(200);
res.end();
req.resume();
-}).listen(0, function() {
+})).listen(0, function() {
authorized();
});
@@ -32,9 +29,7 @@ function authorized() {
port: server.address().port,
rejectUnauthorized: true,
ca: [fs.readFileSync(path.join(common.fixturesDir, 'keys/ca2-cert.pem'))]
- }, function(res) {
- assert(false);
- });
+ }, common.fail);
req.on('error', function(err) {
override();
});
@@ -60,7 +55,3 @@ function override() {
});
req.end();
}
-
-process.on('exit', function() {
- assert.equal(reqCount, 1);
-});