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 <gpunathi@in.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
  • Loading branch information
widatama authored and rvagg committed Nov 28, 2018
1 parent 6abe02f commit 74060e8
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 74060e8

Please sign in to comment.