Evidence vanilla-test 2.1.0

Testing & coverage

The public API is exercised as JavaScript through the author’s own vanilla-test module, then measured without transforming node-cmd source.

53 / 53focused tests passing
100%statements
100%branches
100%functions and lines
01 / Tooling

vanilla-test owns the suite and coverage command

vanilla-test@2.1.0 is node-cmd’s only direct development dependency. Its dependency graph contains only the author’s ansi-colors-es6 and strong-type modules. The shipped package declares no runtime dependencies, and npm does not install the test tool for node-cmd consumers.

{
  "scripts": {
    "test": "node ./test/node.mjs",
    "test:unit": "node ./test/node.mjs unit",
    "test:functional": "node ./test/node.mjs functional",
    "test:behavioral": "node ./test/node.mjs behavioral",
    "test:integration": "node ./test/node.mjs integration",
    "test:regression": "node ./test/node.mjs regression",
    "test:runtime-contract": "node ./scripts/validate-runtime-contract.js",
    "coverage": "vanilla-test coverage node",
    "verify": "npm test && npm run coverage && npm run test:runtime-contract && npm run test:package && npm run site:check"
  },
  "devDependencies": {
    "vanilla-test": "2.1.0"
  }
}

The suite uses VanillaTest for case lifecycle and reporting. Node’s built-in node:assert/strict supplies precise deep equality, rejection, and pattern assertions; no separate assertion framework is installed.

Native-browser conformance: not applicable. The documentation site runs browser JavaScript, but the node-cmd package runtime does not. No browser entry, import map, playground, or Chrome inventory is provided because browsers cannot expose node:child_process. Runtime-dependency conflict testing is likewise not applicable because the package has zero runtime dependencies.
02 / Coverage contract

Per-file native Node coverage gates

vanilla-test coverage node executes the same suite under native V8 coverage and publishes text, HTML, LCOV, and JSON summary reports. Both shipped entry points are included.

{
  "entry": "./test/api.test.js",
  "thresholds": {
    "statements": 100,
    "branches": 100,
    "functions": 100,
    "lines": 100
  },
  "node": {
    "include": ["cmd.js", "cmd.mjs"]
  }
}
SourceStatementsBranchesFunctionsLines
All shipped source100%100%100%100%
cmd.js100%100%100%100%
cmd.mjs100%100%100%100%
Report paths. Local runs write coverage/node/index.html, lcov.info, coverage-summary.json, and a normalized ANSI-free test-results.json. CI publishes the same HTML tree at this site’s coverage report, exposes the machine-readable test results, and retains the complete directory as a workflow artifact.
03 / Behavior inventory

53 focused cases across five independently runnable sets

The original 48 cases keep narrow assertion boundaries. Five black-box Behavioral scenarios add composed and temporal consumer outcomes without changing the runtime implementation or duplicating CI matrix runs.

SetCasesPrimary contractRun alone
Unit5CommonJS and ESM surface plus compatibility aliasesnpm run test:unit
Functional17Normal callback, Promise, sync, direct-file, and stream behaviornpm run test:functional
Behavioral5Shell composition, failure output, buffer limits, timeouts, and live outputnpm run test:behavioral
Integration8Process I/O, environment, cancellation, isolation, and literal argumentsnpm run test:integration
Regression18Overloads, omitted values, buffers, validation, and error normalizationnpm run test:regression
Total53Public execution paths, compatibility edges, and consumer workflowsnpm test
  1. Unit: exact CommonJS exports, both Promise aliases, ESM default identity, and ESM named-export identity.
  2. Functional: successful and failing shell/direct calls, callbacks, Promises, sync envelopes, buffers, process handles, and live streams.
  3. Behavioral: shell command chaining, partial callback output, max-buffer rejection, direct-process timeout, and output observed before stream exit.
  4. Integration: cwd and environment forwarding, interactive stdin, AbortSignal, parent stderr isolation, literal argv, encoding, and explicit stdio.
  5. Regression: callback/options overloads, null and undefined arguments, safe sync defaults, captured buffer failures, validation, and non-Error failures.
Exact case names. The published test-results.json lists all 53 passing descriptions in execution order. The source is divided into unit, functional, behavioral, integration, and regression files.
04 / CI matrix

Minimum runtime, current LTS, and three operating systems

Operating systemNode 22.12Node 24Purpose
UbuntuFull suiteFull suiteUnix shell/process behavior
macOSFull suiteFull suiteDarwin process behavior
WindowsFull suiteFull suiteComSpec, quoting, and Windows process behavior

A separate Node 24 job enforces coverage. A package-smoke job creates the npm tarball, installs it into a clean temporary consumer, verifies bare CommonJS and Node.js ESM imports, confirms version 6.0.1 and the exact shipped files, and proves that development tooling is not installed for consumers.

05 / Reproduce

Run the same gates locally

npm ci
npm test
npm run test:unit
npm run test:functional
npm run test:behavioral
npm run test:integration
npm run test:regression
npm run test:runtime-contract
npm run coverage
npm run test:package
npm run site:check

# everything in release order
npm run verify
npm test
Runs all 53 cases once through vanilla-test.
npm run test:*
Runs Unit, Functional, Behavioral, Integration, or Regression independently while debugging.
npm run coverage
Runs all five sets under the configured Node coverage thresholds.
npm run test:package
Tests what npm consumers actually receive, not the repository worktree.
npm run site:check
Checks every documentation page, local link, shared asset, and client script.
06 / Failure policy

Any failed case or gate stops delivery

vanilla-test returns a structured result with ok and failureCount; the Node adapter maps it to the process exit code. Coverage thresholds, package smoke, and site validation also return nonzero on failure. GitHub Pages only assembles and deploys after tests, coverage, and package verification have all passed.