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

import * as https from "node:https";


// ── Functions ──
// https.createServer([options][, requestListener]) — construct + immediate close.
// No key/cert needed for ctor probe (Node accepts empty options; errors only on listen).
try {
  const s1 = https.createServer({});
  console.log("https.createServer no-listener typeof:", typeof s1);
  s1.close();
  const s2 = https.createServer({}, (_req: any, _res: any) => {});
  console.log("https.createServer w/ listener typeof:", typeof s2);
  s2.close();
} catch (e: any) { console.log("https.createServer threw:", e && e.message); }

// https.get(options[, callback]) — TYPE PROBE ONLY (would dial out over TLS).
// PERRY-SKIP: actual call dials out; only probe typeof to avoid network I/O.
try {
  console.log("https.get typeof:", typeof https.get);
} catch (e: any) { console.log("https.get typeof threw:", e && e.message); }

// https.get(url[, options][, callback]) — TYPE PROBE ONLY.
// PERRY-SKIP: same `https.get` symbol — covered above.

// https.request(options[, callback]) — TYPE PROBE ONLY (would dial out).
// PERRY-SKIP: actual call dials out; only probe typeof to avoid network I/O.
try {
  console.log("https.request typeof:", typeof https.request);
} catch (e: any) { console.log("https.request typeof threw:", e && e.message); }

// https.request(url[, options][, callback]) — TYPE PROBE ONLY.
// PERRY-SKIP: same `https.request` symbol — covered above.

// ── Module Properties ──
// https.globalAgent — probe specific fields rather than full object printout.
try {
  console.log("globalAgent typeof:", typeof https.globalAgent);
  console.log("globalAgent.defaultPort:", https.globalAgent.defaultPort);
  console.log("globalAgent.protocol:", https.globalAgent.protocol);
  console.log("globalAgent.keepAlive:", https.globalAgent.keepAlive);
  console.log("globalAgent.maxSockets:", https.globalAgent.maxSockets);
  console.log("globalAgent.maxFreeSockets:", https.globalAgent.maxFreeSockets);
} catch (e: any) { console.log("globalAgent probe threw:", e && e.message); }

// ── Classes ──
// class https.Agent — probe ctor typeof.
try {
  console.log("Agent typeof:", typeof https.Agent);
} catch (e: any) { console.log("Agent typeof threw:", e && e.message); }

// new https.Agent([options]) — construct, probe surface, then destroy.
try {
  const a = new https.Agent({keepAlive: true, maxSockets: 5});
  console.log("agent typeof:", typeof a);
  // agent.defaultPort / protocol — instance defaults.
  console.log("agent.defaultPort:", a.defaultPort);
  console.log("agent.protocol:", a.protocol);
  // agent.maxSockets / maxFreeSockets / keepAlive — set on ctor.
  console.log("agent.maxSockets:", a.maxSockets);
  console.log("agent.keepAlive:", a.keepAlive);
  // agent.createConnection(options[, callback]) — type probe.
  console.log("agent.createConnection typeof:", typeof a.createConnection);
  // agent.keepSocketAlive(socket) — type probe.
  console.log("agent.keepSocketAlive typeof:", typeof a.keepSocketAlive);
  // agent.reuseSocket(socket, request) — type probe.
  console.log("agent.reuseSocket typeof:", typeof a.reuseSocket);
  // agent.getName([options]) — deterministic with fixed input.
  console.log("agent.getName typeof:", typeof a.getName);
  try {
    const n = a.getName({host: "127.0.0.1", port: 443});
    console.log("agent.getName result typeof:", typeof n);
  } catch (e: any) { console.log("agent.getName threw:", e && e.message); }
  // agent.destroy() — scoped final call.
  console.log("agent.destroy typeof:", typeof a.destroy);
  a.destroy();
  console.log("agent.destroy ok:", true);
} catch (e: any) { console.log("Agent ctor threw:", e && e.message); }

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