Skip to content

Commit

Permalink
test: allow numeric string for lookupService test
Browse files Browse the repository at this point in the history
Fixes: nodejs/node#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: nodejs/node#42596
Reviewed-By: Mohammed Keyvanzadeh <[email protected]>
Reviewed-By: Akhil Marsonya <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
  • Loading branch information
daeyeon authored and guangwong committed Oct 10, 2022
1 parent a117092 commit 02feae2
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 02feae2

Please sign in to comment.