diff options
author | Rich Trott <rtrott@gmail.com> | 2020-02-08 06:14:14 -1000 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2020-02-10 07:42:44 -1000 |
commit | 84836df1503467e53e22bdc0723897acc5d756c4 (patch) | |
tree | 85b01d01b2a8432f9ff4cc158c0878ff311924f5 /test/internet | |
parent | f938cbd77d487559d273a975bb43ecf8439f9146 (diff) | |
download | node-new-84836df1503467e53e22bdc0723897acc5d756c4.tar.gz |
test: improve assertion message in test-dns-any
Improve error message from "The expression evaluated to a falsy value"
to a message formatted dynamically that lists the record types found so
that someone investigating can look at the code and determine which
values are missing.
This came up because the test failed in nightly master branch CI but
generally passes. It may prove helpful to know what record types were
missing. (All of them? Just one? Something else?)
PR-URL: https://github.com/nodejs/node/pull/31697
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test/internet')
-rw-r--r-- | test/internet/test-dns-any.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/internet/test-dns-any.js b/test/internet/test-dns-any.js index e8425a6ca5..3e8eb07e7e 100644 --- a/test/internet/test-dns-any.js +++ b/test/internet/test-dns-any.js @@ -119,8 +119,8 @@ TEST(async function test_google(done) { function validateResult(res) { const types = processResult(res); assert.ok( - types.A && types.AAAA && types.MX && - types.NS && types.TXT && types.SOA); + types.A && types.AAAA && types.MX && types.NS && types.TXT && types.SOA, + `Missing record type, found ${Object.keys(types)}`); } validateResult(await dnsPromises.resolve('google.com', 'ANY')); @@ -140,7 +140,8 @@ TEST(async function test_google(done) { TEST(async function test_sip2sip_for_naptr(done) { function validateResult(res) { const types = processResult(res); - assert.ok(types.A && types.NS && types.NAPTR && types.SOA); + assert.ok(types.A && types.NS && types.NAPTR && types.SOA, + `Missing record type, found ${Object.keys(types)}`); } validateResult(await dnsPromises.resolve('sip2sip.info', 'ANY')); |