Skip to content

Commit db7fa9f

Browse files
authored
test: allow numeric string for lookupService test
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 <[email protected]> Reviewed-By: Akhil Marsonya <[email protected]> Reviewed-By: Richard Lau <[email protected]>
1 parent 35d72bf commit db7fa9f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎test/parallel/test-dns-lookupService-promises.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const assert = require('assert');
66
constdnsPromises=require('dns').promises;
77

88
dnsPromises.lookupService('127.0.0.1',22).then(common.mustCall((result)=>{
9-
assert.strictEqual(result.service,'ssh');
9+
assert(['ssh','22'].includes(result.service));
1010
assert.strictEqual(typeofresult.hostname,'string');
1111
assert.notStrictEqual(result.hostname.length,0);
1212
}));

0 commit comments

Comments
(0)