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.
  • Loading branch information
daeyeon committed Apr 4, 2022
1 parent df20947 commit 3031525
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'].some((x) => x === result.service));
assert.strictEqual(typeof result.hostname, 'string');
assert.notStrictEqual(result.hostname.length, 0);
}));
Expand Down

0 comments on commit 3031525

Please sign in to comment.