mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
test: improve dns internet test case
0.0.0.0 is more common than other special ipv4 addresses, so it is possible that we may not get ENOTFOUND for such addresses. Instead, this commit uses a less common address that is reserved for documentation (RFC) use only. PR-URL: https://github.com/nodejs/node/pull/13261 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
1 file changed
+4
-3
@@ -492,11 +492,12 @@ TEST(function test_lookupservice_invalid(done) {
|
||||
|
||||
|
||||
TEST(function test_reverse_failure(done) {
|
||||
const req = dns.reverse('0.0.0.0', function(err) {
|
||||
// 203.0.113.0/24 are addresses reserved for (RFC) documentation use only
|
||||
const req = dns.reverse('203.0.113.0', function(err) {
|
||||
assert(err instanceof Error);
|
||||
assert.strictEqual(err.code, 'ENOTFOUND'); // Silly error code...
|
||||
assert.strictEqual(err.hostname, '0.0.0.0');
|
||||
assert.ok(/0\.0\.0\.0/.test(err.message));
|
||||
assert.strictEqual(err.hostname, '203.0.113.0');
|
||||
assert.ok(/203\.0\.113\.0/.test(err.message));
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user