From 8486917b9a2006ee26b7003c5425c5e8586c9b8f Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 20 Apr 2019 21:01:17 -0700 Subject: [PATCH] test: increase coverage in lib/internal/dns/promises.js Add a test for the only uncovered code in lib/internal/dns/promises.js. PR-URL: https://github.com/nodejs/node/pull/27330 Reviewed-By: Yongsheng Zhang Reviewed-By: Ruben Bridgewater Reviewed-By: Michael Dawson --- test/parallel/test-dns-lookupService.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/parallel/test-dns-lookupService.js b/test/parallel/test-dns-lookupService.js index 92fce6cbd3f189..f78e98766063f7 100644 --- a/test/parallel/test-dns-lookupService.js +++ b/test/parallel/test-dns-lookupService.js @@ -18,3 +18,12 @@ assert.throws( syscall: 'getnameinfo' } ); + +assert.rejects( + dns.promises.lookupService('127.0.0.1', 80), + { + code: 'ENOENT', + message: 'getnameinfo ENOENT 127.0.0.1', + syscall: 'getnameinfo' + } +);