Skip to content

Commit

Permalink
test: use common.mustCall()
Browse files Browse the repository at this point in the history
  • Loading branch information
Trott committed Aug 24, 2015
1 parent 079257f commit a8cb028
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions test/parallel/test-https-simple.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const options = {
};

const tests = 2;
let reqReceivedCount = 0;
let successful = 0;

const testSucceeded = function() {
Expand All @@ -28,12 +27,12 @@ const testSucceeded = function() {

const body = 'hello world\n';

const server = https.createServer(options, function(req, res) {
reqReceivedCount++;
const serverCallback = common.mustCall(function(req, res) {
res.writeHead(200, { 'content-type': 'text/plain' });
res.end(body);
});

const server = https.createServer(options, serverCallback);

server.listen(common.PORT, function() {
// Do a request ignoring the unauthorized server certs
Expand Down Expand Up @@ -89,6 +88,5 @@ server.listen(common.PORT, function() {
});

process.on('exit', function() {
assert.equal(1, reqReceivedCount);
assert.equal(successful, tests);
});

0 comments on commit a8cb028

Please sign in to comment.