test: improve code in test-http-bind-twice.js
* use const instead of var for required modules * use assert.strictEqual instead of assert.equal PR-URL: https://github.com/nodejs/node/pull/10318 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
e248f7f9e7
commit
80f19b043d
@ -1,15 +1,15 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
var assert = require('assert');
|
const assert = require('assert');
|
||||||
var http = require('http');
|
const http = require('http');
|
||||||
|
|
||||||
var server1 = http.createServer(common.fail);
|
const server1 = http.createServer(common.fail);
|
||||||
server1.listen(0, '127.0.0.1', common.mustCall(function() {
|
server1.listen(0, '127.0.0.1', common.mustCall(function() {
|
||||||
var server2 = http.createServer(common.fail);
|
const server2 = http.createServer(common.fail);
|
||||||
server2.listen(this.address().port, '127.0.0.1', common.fail);
|
server2.listen(this.address().port, '127.0.0.1', common.fail);
|
||||||
|
|
||||||
server2.on('error', common.mustCall(function(e) {
|
server2.on('error', common.mustCall(function(e) {
|
||||||
assert.equal(e.code, 'EADDRINUSE');
|
assert.strictEqual(e.code, 'EADDRINUSE');
|
||||||
server1.close();
|
server1.close();
|
||||||
}));
|
}));
|
||||||
}));
|
}));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user