Tests & coverage

Quality is part of
the public API.

One canonical registry assigns every test once to Unit, Functional, Behavioral, Integration, or Regression. vanilla-test 2.1.0 runs it directly and collects native V8 coverage, while older supported Node releases use the local compatibility adapter. A shared Given/When/Then inventory also proves the bare package import in Node and real Chrome.

strong-type works with bundlers and without a bundler. Bundlers resolve bare imports normally; native browser ESM uses an explicit import map with no build or transpilation step.

1,268passed
0failed
13guarded skips
11CI jobs

Native V8 coverage

Current production-source coverage.

Measured on Node 24.18.0 after the full five-suite registry. Only the two shipped runtime files are included.

Coverage by shipped source file
SourceExecutable rangesBlock rangesFunction rangesExecutable lines
index.js90.00% · 306/34071.05% · 81/11499.55% · 225/22690.87% · 926/1019
node.js88.23% · 30/3480.00% · 8/1091.66% · 22/2491.91% · 91/99
Total89.83% · 336/37471.77% · 89/12498.80% · 247/25090.96% · 1017/1118
Coverage release gates
Per-file gateLowest current fileRequiredStatus
Executable ranges88.23%85%Pass
Block ranges71.05%65%Pass
Function ranges91.66%90%Pass
Executable lines90.87%90%Pass
VanillaTest reports the executable and block ranges emitted directly by V8. Those native range metrics are not interchangeable with parser-derived statement or branch counts. Test, documentation, and static-site files are excluded.

Test suites

Five suites. One owner for every test.

Node 24.18.0 test snapshot
SuiteResultWhat it covers
Unit586 passed · 13 guarded skipsAtomic validator contracts across all 201 core and Node validators, including guarded capabilities.
Functional15 passedStrict and non-strict modes, unions, custom validators, and Node adapter inheritance.
Behavioral8 passedConsumer order boundaries, untrusted JSON filtering, identifier routing, domain extensions, Node uploads, and thenable safety.
Integration636 passedReference and README completeness, import-map order and targets, package exports, packed-consumer configuration, deployment assertions, and CI wiring.
Regression23 passedCoercion fixes, cross-realm brands, spoof resistance, revoked proxies, and cleanup resilience.
Total1,268 passed · 0 failed · 13 skippedFive exclusive suites, plus seven shared behaviors passing in both Node and real Chrome.
A guarded skip means the current runtime does not expose that host API. It is a capability result, not an ignored failure.

Compatibility matrix

Oldest supported Node. Current platforms.

GitHub Actions CI jobs
Job groupRuntime / platformCommandPurpose
Compatibility · 5 jobsNode 12.21.0, 18, 20, 22.12, 24 · UbuntuCompatibility adapter; primary runner at 22.12Syntax, imports, validators, guarded capabilities, and the minimum supported vanilla-test runtime.
Platforms · 3 jobsNode 24 · Ubuntu, macOS, Windowsnpm testCross-platform behavior.
Native coverage · 1 jobNode 24 · Ubuntunpm run coverageProduction-source metrics and enforced floors.
Package · 1 jobNode 24 · Ubuntunpm run test:packageTarball inventory, isolated install, production dependency tree, and every supported ESM entry.
Native browser · 1 jobNode 24 + real Chrome · Ubuntunpm run test:conformanceThe same seven bare-import behavioral scenarios in both runtimes.

Open current CI results

Run it yourself

One pinned test runner.

Project commands
CommandWhat it doesThird-party tooling
npm testRuns all five suites from the canonical registry.vanilla-test 2.1.0
npm run test:unitRuns atomic core and Node validator contracts.vanilla-test 2.1.0
npm run test:functionalRuns public mode, union, and adapter workflows.vanilla-test 2.1.0
npm run test:behavioralRuns observable consumer workflows and side-effect boundaries.vanilla-test 2.1.0
npm run test:integrationRuns documentation, package, site, and tooling boundaries.vanilla-test 2.1.0
npm run test:regressionRuns corrected edge cases and hostile-value protections.vanilla-test 2.1.0
npm run test:legacyRuns the same registered cases through the compatibility adapter.None
npm run test:browserRuns the shared native-browser inventory in real Chrome.vanilla-test 2.1.0
npm run test:conformanceRuns the same bare-import inventory in Node and real Chrome.vanilla-test 2.1.0
npm run test:browser-contractStatically verifies metadata, documentation, import-map order and targets, and the assembled site.None
npm run test:packagePacks and installs the candidate in an isolated ESM consumer.npm
npm run coverageRuns the canonical registry through VanillaTest’s native Node V8 collector.vanilla-test 2.1.0
npm startServes the static site at localhost:8000.None
Terminal
npm test
npm run test:conformance
npm run coverage

The native-browser fixture keeps this complete npm-layout import map before its module script:

HTML
<script type="importmap">
{
    "imports": {
        "strong-type": "./node_modules/strong-type/index.js"
    }
}
</script>

<script type="module">
    import Is from 'strong-type';
    console.log(new Is(false).string('native ESM'));
</script>

Those mapped paths are relative to the HTML document. The app must be served over HTTP(S), and its server must expose the files; file:// is unsupported. There are no runtime dependencies, so this map needs no dependency entries or nested-version scopes.

Coverage boundaries

What these numbers do—and do not—say.

Measurement boundaries
AreaMeasured hereDetail
Core and Node sourceYesExecutable-range, block-range, function-range, and executable-line coverage from V8.
Browser runtimeBehavior testedSeven observable Given/When/Then scenarios run unchanged in Node and real Chrome through the bare import and explicit map. The numerical table remains Node/V8 coverage.
Unavailable host APIsGuard testedStrict TypeError and weak false behavior are checked when a capability is absent.
Browser result DOMAutomatedThe native no-bundler fixture renders a passed/failed state and each scenario description after Chrome executes the shared inventory.