// Auto-generated by scripts/gen_parity_tests.py from docs/runtime-parity.md.
// Module: node:test
// 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_test` to verify.
//
// NOTE: Calling test()/describe()/it()/etc. would schedule tests and emit TAP
// output (paths, durations, file:line refs — none stable). We probe types and
// existence only — never invoke the runner.

import * as test from "node:test";


// ── Core Test Functions ──
console.log("test type:", typeof test);
console.log("test.skip type:", typeof test.skip);
console.log("test.todo type:", typeof test.todo);
console.log("test.only type:", typeof test.only);
console.log("suite type:", typeof test.suite);
console.log("suite.skip type:", typeof (test.suite && test.suite.skip));
console.log("suite.todo type:", typeof (test.suite && test.suite.todo));
console.log("suite.only type:", typeof (test.suite && test.suite.only));
console.log("describe type:", typeof test.describe);
console.log("describe.skip type:", typeof (test.describe && test.describe.skip));
console.log("describe.todo type:", typeof (test.describe && test.describe.todo));
console.log("describe.only type:", typeof (test.describe && test.describe.only));
console.log("it type:", typeof test.it);
console.log("it.skip type:", typeof (test.it && test.it.skip));
console.log("it.todo type:", typeof (test.it && test.it.todo));
console.log("it.only type:", typeof (test.it && test.it.only));

// ── Lifecycle Hooks ──
console.log("before type:", typeof test.before);
console.log("after type:", typeof test.after);
console.log("beforeEach type:", typeof test.beforeEach);
console.log("afterEach type:", typeof test.afterEach);

// ── Test Runner ──
// run() returns a TestsStream. Calling it would start running tests and stream
// 'test:start'/'test:pass'/etc. events. Probe type only.
console.log("run type:", typeof test.run);

// ── TestContext ──
// TestContext (t) is only available inside a running test callback — we cannot
// construct one without entering the runner. Probe via the global mock tracker
// for the names it shares with t.mock, and stay descriptive otherwise.
console.log("TestContext: only-available-inside-test-callback");
// t.test, t.skip, t.todo, t.before, t.after, t.beforeEach, t.afterEach,
// t.diagnostic, t.plan, t.runOnly, t.waitFor, t.assert, t.assert.register,
// t.assert.snapshot, t.assert.fileSnapshot — all instance methods of the
// TestContext class; not directly probable from module scope.

// ── SuiteContext ──
console.log("SuiteContext: only-available-inside-suite-callback");
// s.name, s.fullName, s.filePath, s.signal, s.passed, s.attempt, s.diagnostic
// — all instance members of the SuiteContext class; not directly probable.

// ── MockTracker (mock / context.mock) ──
console.log("mock type:", typeof test.mock);
console.log("mock.fn type:", typeof (test.mock && test.mock.fn));
console.log("mock.method type:", typeof (test.mock && test.mock.method));
console.log("mock.getter type:", typeof (test.mock && test.mock.getter));
console.log("mock.setter type:", typeof (test.mock && test.mock.setter));
console.log("mock.property type:", typeof (test.mock && test.mock.property));
console.log("mock.module type:", typeof (test.mock && test.mock.module));
console.log("mock.reset type:", typeof (test.mock && test.mock.reset));
console.log("mock.restoreAll type:", typeof (test.mock && test.mock.restoreAll));

// ── MockFunctionContext ──
// Created by mock.fn(). Probe the .mock context shape without invoking the fn,
// so callCount stays 0 and calls stays []. Don't print the .calls array or any
// internal field that includes function pointers / wrapped originals.
// SKIP-PROBE: constructing a mock.fn requires test.mock to be callable; if it
// isn't on this runtime, the probe must not throw — guard with typeof.
if (typeof test.mock !== "undefined" && typeof test.mock.fn === "function") {
  const m = test.mock.fn();
  console.log("mock.fn() typeof:", typeof m);
  console.log("mock.fn().mock typeof:", typeof m.mock);
  console.log("mock.fn().mock.calls typeof:", typeof m.mock.calls);
  console.log("mock.fn().mock.calls isArray:", Array.isArray(m.mock.calls));
  console.log("mock.fn().mock.calls.length:", m.mock.calls.length);
  console.log("mock.fn().mock.callCount typeof:", typeof m.mock.callCount);
  console.log("mock.fn().mock.callCount():", m.mock.callCount());
  console.log("mock.fn().mock.resetCalls typeof:", typeof m.mock.resetCalls);
  console.log("mock.fn().mock.mockImplementation typeof:", typeof m.mock.mockImplementation);
  console.log("mock.fn().mock.mockImplementationOnce typeof:", typeof m.mock.mockImplementationOnce);
  console.log("mock.fn().mock.restore typeof:", typeof m.mock.restore);
} else {
  console.log("mock.fn(): SKIP — test.mock.fn not available");
}

// ── MockPropertyContext ──
// mock.property(obj, "name", value) installs a property mock and returns the
// MockPropertyContext. Probe the shape against a throwaway object.
if (typeof test.mock !== "undefined" && typeof test.mock.property === "function") {
  const target: { x: number } = { x: 1 };
  const p = test.mock.property(target, "x", 42);
  console.log("mock.property() typeof:", typeof p);
  console.log("mock.property().accesses typeof:", typeof p.accesses);
  console.log("mock.property().accesses isArray:", Array.isArray(p.accesses));
  console.log("mock.property().accessCount typeof:", typeof p.accessCount);
  console.log("mock.property().resetAccesses typeof:", typeof p.resetAccesses);
  console.log("mock.property().mockImplementation typeof:", typeof p.mockImplementation);
  console.log("mock.property().mockImplementationOnce typeof:", typeof p.mockImplementationOnce);
  // Restore so the mock doesn't leak across other probes.
  if (typeof p.restore === "function") {
    p.restore();
  }
} else {
  console.log("mock.property(): SKIP — test.mock.property not available");
}

// ── MockTimers (mock.timers) ──
// mock.timers.enable() captures the global timers (setTimeout, setInterval,
// Date, etc.). Probe types, optionally enable + reset back to defaults.
if (typeof test.mock !== "undefined" && typeof test.mock.timers !== "undefined") {
  console.log("mock.timers typeof:", typeof test.mock.timers);
  console.log("mock.timers.enable typeof:", typeof test.mock.timers.enable);
  console.log("mock.timers.reset typeof:", typeof test.mock.timers.reset);
  console.log("mock.timers.tick typeof:", typeof test.mock.timers.tick);
  console.log("mock.timers.runAll typeof:", typeof test.mock.timers.runAll);
  console.log("mock.timers.setTime typeof:", typeof test.mock.timers.setTime);
  // [Symbol.dispose] — presence only, no call.
  const disposeFn = (test.mock.timers as any)[Symbol.dispose];
  console.log("mock.timers[Symbol.dispose] typeof:", typeof disposeFn);
} else {
  console.log("mock.timers: SKIP — test.mock.timers not available");
}

// ── Snapshot ──
console.log("snapshot typeof:", typeof (test as any).snapshot);
console.log("snapshot.setDefaultSnapshotSerializers typeof:",
  typeof ((test as any).snapshot && (test as any).snapshot.setDefaultSnapshotSerializers));
console.log("snapshot.setResolveSnapshotPath typeof:",
  typeof ((test as any).snapshot && (test as any).snapshot.setResolveSnapshotPath));

// ── node:test/reporters ──
// Probed via dynamic require to keep this file single-import. The reporters
// module exports stream-transform factories. Probe types only.
// NOTE: node:test/reporters would need a separate `import * as reporters from
// "node:test/reporters"` to probe directly; document expected shape instead.
console.log("reporters.spec: expected typeof function (or object stream)");
console.log("reporters.tap: expected typeof function (or object stream)");
console.log("reporters.dot: expected typeof function (or object stream)");
console.log("reporters.junit: expected typeof function (or object stream)");
console.log("reporters.lcov: expected typeof function (or object stream)");

// ── TestsStream Events (run() return value) ──
// These are emitted by the TestsStream that run() returns. We do not call run()
// here (it would start the runner). The event names are stable strings; we
// just confirm they're string literals that match the spec.
console.log("'test:start'");
console.log("'test:plan'");
console.log("'test:pass'");
console.log("'test:fail'");
console.log("'test:complete'");
console.log("'test:diagnostic'");
console.log("'test:coverage'");
console.log("'test:enqueue'");
console.log("'test:dequeue'");
console.log("'test:watch:drained'");
console.log("'test:watch:restarted'");
console.log("'test:stderr'");
console.log("'test:stdout'");
console.log("'test:summary'");
console.log("'test:interrupted'");

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