diff --git a/test/parallel/test-http-unix-socket.js b/test/parallel/test-http-unix-socket.js index 69c887b53b..d2b99bde95 100644 --- a/test/parallel/test-http-unix-socket.js +++ b/test/parallel/test-http-unix-socket.js @@ -1,9 +1,9 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var http = require('http'); +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); -var server = http.createServer(function(req, res) { +const server = http.createServer(function(req, res) { res.writeHead(200, { 'Content-Type': 'text/plain', 'Connection': 'close' @@ -23,8 +23,8 @@ server.listen(common.PIPE, common.mustCall(function() { }; var req = http.get(options, common.mustCall(function(res) { - assert.equal(res.statusCode, 200); - assert.equal(res.headers['content-type'], 'text/plain'); + assert.strictEqual(res.statusCode, 200); + assert.strictEqual(res.headers['content-type'], 'text/plain'); res.body = ''; res.setEncoding('utf8'); @@ -34,19 +34,18 @@ server.listen(common.PIPE, common.mustCall(function() { }); res.on('end', common.mustCall(function() { - assert.equal(res.body, 'hello world\n'); - server.close(function(error) { - assert.equal(error, undefined); - server.close(function(error) { - assert.equal(error && error.message, 'Not running'); - }); - }); + assert.strictEqual(res.body, 'hello world\n'); + server.close(common.mustCall(function(error) { + assert.strictEqual(error, undefined); + server.close(common.mustCall(function(error) { + assert.strictEqual(error && error.message, 'Not running'); + })); + })); })); })); req.on('error', function(e) { - console.log(e.stack); - process.exit(1); + common.fail(e.stack); }); req.end();