A zero exit status can hide skipped tests

On November 15, 2026, with Node.js 22.23.4, we ran the included skipped.test.mjs. Node exited with status 0 even though the only test was skipped: the summary reported pass 0 and skipped 1. This is a local test-runner observation, not an AI model evaluation.

The illustrative gate.mjs checks a trusted Node 22 default TAP summary and requires at least one passing test, no failures, skips, cancellations or TODOs, and a zero exit status. The included gate.test.mjs tests three cases: a passing test is accepted; a skipped test is rejected even though its runner exits 0; a failing test is rejected. All three checks passed locally on the date above.

Put all five .mjs files in one directory. Run:
  node --test skipped.test.mjs
  node gate.mjs skipped.test.mjs
  node --test gate.test.mjs

The second command intentionally returns exit status 1: rejection is the expected outcome. The gate is an illustration, not a security boundary. It runs the supplied test file and must only be used with trusted code in an isolated environment. A passing count cannot prove that a test checks the right requirement, that all intended tests were discovered, or that output was not manipulated. Results and TAP formatting can differ by Node version; missing summary fields are treated as inconclusive. Review test selection and behavior independently.

Node documentation: https://nodejs.org/docs/latest-v22.x/api/test.html
