// Auto-generated by scripts/gen_parity_tests.py from docs/runtime-parity.md.
// Module: node:dns
// This file is a byte-for-byte parity test against `node --experimental-strip-types`.
// Edit the TODO lines below to exercise each API; rerun
// `./run_parity_tests.sh --filter test_parity_dns` to verify.

import * as dns from "node:dns";


// ── Functions (Callback API) ──
// Non-deterministic resolution APIs — only probe types/presence, never call.
console.log("typeof dns.lookup:", typeof dns.lookup);
// PERRY-SKIP: dns.lookupService — requires live reverse lookup.
console.log("typeof dns.lookupService:", typeof dns.lookupService);
console.log("typeof dns.resolve:", typeof dns.resolve);
console.log("typeof dns.resolve4:", typeof dns.resolve4);
console.log("typeof dns.resolve6:", typeof dns.resolve6);
console.log("typeof dns.resolveAny:", typeof dns.resolveAny);
console.log("typeof dns.resolveCaa:", typeof dns.resolveCaa);
console.log("typeof dns.resolveCname:", typeof dns.resolveCname);
console.log("typeof dns.resolveMx:", typeof dns.resolveMx);
console.log("typeof dns.resolveNaptr:", typeof dns.resolveNaptr);
console.log("typeof dns.resolveNs:", typeof dns.resolveNs);
console.log("typeof dns.resolvePtr:", typeof dns.resolvePtr);
console.log("typeof dns.resolveSoa:", typeof dns.resolveSoa);
console.log("typeof dns.resolveSrv:", typeof dns.resolveSrv);
console.log("typeof dns.resolveTlsa:", typeof dns.resolveTlsa);
console.log("typeof dns.resolveTxt:", typeof dns.resolveTxt);
console.log("typeof dns.reverse:", typeof dns.reverse);
try {
  const servers = dns.getServers();
  console.log("dns.getServers isArray:", Array.isArray(servers));
  console.log("dns.getServers length typeof:", typeof servers.length);
  dns.setServers(servers);
  console.log("dns.setServers: ok");
} catch (e) {
  console.log("dns.getServers/setServers error:", (e as Error).message);
}
try {
  dns.setDefaultResultOrder("ipv4first");
  console.log("dns.setDefaultResultOrder('ipv4first'): ok");
} catch (e) {
  console.log("dns.setDefaultResultOrder error:", (e as Error).message);
}
console.log("dns.getDefaultResultOrder():", dns.getDefaultResultOrder());

// ── Classes ──
console.log("class dns.Resolver typeof:", typeof dns.Resolver);
try {
  const r = new dns.Resolver();
  console.log("new dns.Resolver typeof:", typeof r);
  console.log("resolver.cancel typeof:", typeof r.cancel);
  console.log("resolver.setLocalAddress typeof:", typeof r.setLocalAddress);
  const rsrv = r.getServers();
  console.log("resolver.getServers isArray:", Array.isArray(rsrv));
  console.log("resolver.getServers length typeof:", typeof rsrv.length);
  console.log("resolver.setServers typeof:", typeof r.setServers);
} catch (e) {
  console.log("Resolver error:", (e as Error).message);
}

// ── Constants / Error Codes ──
console.log("dns.ADDRCONFIG:", dns.ADDRCONFIG);
console.log("dns.V4MAPPED:", dns.V4MAPPED);
console.log("dns.ALL:", dns.ALL);
console.log("dns.NODATA:", dns.NODATA);
console.log("dns.FORMERR:", dns.FORMERR);
console.log("dns.SERVFAIL:", dns.SERVFAIL);
console.log("dns.NOTFOUND:", dns.NOTFOUND);
console.log("dns.NOTIMP:", dns.NOTIMP);
console.log("dns.REFUSED:", dns.REFUSED);
console.log("dns.BADQUERY:", dns.BADQUERY);
console.log("dns.BADNAME:", dns.BADNAME);
console.log("dns.BADFAMILY:", dns.BADFAMILY);
console.log("dns.BADRESP:", dns.BADRESP);
console.log("dns.CONNREFUSED:", dns.CONNREFUSED);
console.log("dns.TIMEOUT:", dns.TIMEOUT);
console.log("dns.EOF:", dns.EOF);
console.log("dns.FILE:", dns.FILE);
console.log("dns.NOMEM:", dns.NOMEM);
console.log("dns.DESTRUCTION:", dns.DESTRUCTION);
console.log("dns.BADSTR:", dns.BADSTR);
console.log("dns.BADFLAGS:", dns.BADFLAGS);
console.log("dns.NONAME:", dns.NONAME);
console.log("dns.BADHINTS:", dns.BADHINTS);
console.log("dns.NOTINITIALIZED:", dns.NOTINITIALIZED);
console.log("dns.LOADIPHLPAPI:", dns.LOADIPHLPAPI);
console.log("dns.ADDRGETNETWORKPARAMS:", dns.ADDRGETNETWORKPARAMS);
console.log("dns.CANCELLED:", dns.CANCELLED);

// Coverage: 29 auto-emitted, 25 TODO, 0 skip-listed.
