// Auto-generated by scripts/gen_parity_tests.py from docs/runtime-parity.md.
// Module: node:dns/promises
// 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_promises` to verify.

import * as dns_promises from "node:dns/promises";


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

// ── localhost lookup (deterministic) ──
async function probeLocalhost() {
  try {
    const r = await dns_promises.lookup("localhost");
    console.log("loopback:", r.address === "127.0.0.1" || r.address === "::1");
    console.log("loopback family typeof:", typeof r.family);
  } catch (e) {
    console.log("loopback error:", (e as Error).message);
  }
}
probeLocalhost();

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

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