From a38c1226852a3741d7013a83497328b4ba2ba1e4 Mon Sep 17 00:00:00 2001 From: Daeyeon Jeong Date: Tue, 12 Apr 2022 21:27:05 +0900 Subject: [PATCH] test: allow numeric string for lookupService test Fixes: https://github.com/nodejs/node/issues/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: https://github.com/nodejs/node/pull/42596 Reviewed-By: Mohammed Keyvanzadeh Reviewed-By: Akhil Marsonya Reviewed-By: Richard Lau --- test/parallel/test-dns-lookupService-promises.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-dns-lookupService-promises.js b/test/parallel/test-dns-lookupService-promises.js index d7e50f194da8a1..4052139c922389 100644 --- a/test/parallel/test-dns-lookupService-promises.js +++ b/test/parallel/test-dns-lookupService-promises.js @@ -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); }));