Skip to content

Samples

Each public sample demonstrates the same Parity proof in a different ecosystem. The samples are split into individual repositories so each one can install the public Packagist package during CI and prove the release path without private tokens.

SampleLanguage/frameworkTest runnerCoverage inputRepository
PHPPlain PHPFixture coverageParity JSONphp-sample
LaravelLaravel-style PHPFixture coverageParity JSONlaravel-sample
TypeScriptTypeScript utilityFixture coverageParity JSONtypescript-sample
AdonisJSAdonisJS-style TypeScriptFixture coverageParity JSONadonisjs-sample
RustPlain RustFixture coverageParity JSONrust-sample
CargoCargo projectCargoParity JSONcargo-sample
PHPUnitPHPPHPUnitParity JSONphpunit-sample
PestPHPPestParity JSONpest-sample
JestJavaScriptJestParity JSONjest-sample
MochaJavaScriptMocha + NYCParity JSONmocha-sample
VitestTypeScriptVitestParity JSONvitest-sample

The Proof

Every sample is built around the same coverage shape:

ScopeCoverage
Project/global coverage80%
Weaker file, all tests70%
Weaker file, matching test only40%
Stronger file, all tests90%
Stronger file, matching test only90%

This proves that healthy global coverage can hide thin direct tests. Parity exposes that gap with matched-coverage and coverage-attribution.

Attribution Format

The samples use parity-coverage.json, a language-neutral attribution file:

json
{
  "version": 1,
  "globalPercent": 80,
  "files": [
    {
      "path": "src/formatCurrency.ts",
      "coveragePercent": 70,
      "totalExecutableLines": 10,
      "lines": [
        {
          "line": 1,
          "coveredBy": ["formatCurrency.test::coversPrimaryBehavior"]
        }
      ]
    }
  ]
}

CI Contract

Each sample runs the public package:

bash
composer global require testparity/parity --prefer-dist --no-progress --no-interaction
parity check --format=json

That makes the samples useful as release proof, not just documentation examples.