Skip to content

Commit

Permalink
test: allow numeric string for lookupService test
Browse files Browse the repository at this point in the history
Fixes: #42164

If the given port number isn't associated with any service name,
the `service` resolved from `dns.lookupService` can be a numeric
string representing the port number.

PR-URL: #42596
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
  • Loading branch information
daeyeon authored and targos committed Jul 31, 2022
1 parent 47f7b34 commit a38c122
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/parallel/test-dns-lookupService-promises.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const assert = require('assert');
const dnsPromises = require('dns').promises;

dnsPromises.lookupService('127.0.0.1', 22).then(common.mustCall((result) => {
assert.strictEqual(result.service, 'ssh');
assert(['ssh', '22'].includes(result.service));
assert.strictEqual(typeof result.hostname, 'string');
assert.notStrictEqual(result.hostname.length, 0);
}));
Expand Down

0 comments on commit a38c122

Please sign in to comment.