Skip to content

Commit

Permalink
test: fix http local address test assertion
Browse files Browse the repository at this point in the history
Reverse the argument for assertion. The first argument should be the
actual value and the second value should be the expected value. When
there is an AssertionError, the expected and actual value will be
labeled correctly.

PR-URL: #23451
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
  • Loading branch information
widatama authored and MylesBorins committed Nov 29, 2018
1 parent 7e38e9e commit ee3c23d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/parallel/test-http-localaddress.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const assert = require('assert');

const server = http.createServer(function(req, res) {
console.log(`Connect from: ${req.connection.remoteAddress}`);
assert.strictEqual('127.0.0.2', req.connection.remoteAddress);
assert.strictEqual(req.connection.remoteAddress, '127.0.0.2');

req.on('end', function() {
res.writeHead(200, { 'Content-Type': 'text/plain' });
Expand Down

0 comments on commit ee3c23d

Please sign in to comment.