Browse Source

test: internet/test-dns handle ESERVFAIL

ESERVFAIL is also an acceptable error code when failing to resolve a
domain.
v0.11.12-release
Timothy J Fontaine 11 years ago
parent
commit
265fdc8e91
  1. 11
      test/internet/test-dns.js

11
test/internet/test-dns.js

@ -456,7 +456,16 @@ TEST(function test_lookup_failure(done) {
TEST(function test_resolve_failure(done) {
var req = dns.resolve4('nosuchhostimsure', function(err) {
assert(err instanceof Error);
assert.strictEqual(err.code, 'ENOTFOUND'); // Silly error code...
switch(err.code) {
case 'ENOTFOUND':
case 'ESERVFAIL':
break;
default:
assert.strictEqual(err.code, 'ENOTFOUND'); // Silly error code...
break;
}
assert.strictEqual(err.hostname, 'nosuchhostimsure');
done();

Loading…
Cancel
Save