Conformance Test Kit

Reference test fixtures and runners for verifying that your INHERIT validator behaves correctly. Essential for anyone building their own validation tooling.

Multi-language v6.1.13 min read
Package: conformance-kit

Getting started#

Install from npm:

bash
npm install @openinherit/conformance

Or clone from the repository:

bash
git clone https://github.com/openinherit/standard.git
cd standard/packages/conformance

What’s included#

Path Contents
schemas/ Bundled schemas: inherit-v3-bundled.json, catalogue-v3-bundled.json
estate/valid/ 12 valid estate documents
estate/invalid/ 9 invalid estate documents
catalogue/valid/ 1 valid catalogue document
catalogue/invalid/ 2 invalid catalogue documents
expected/ Expected results — one .expected.json per fixture
manifest.json Machine-readable list of all tests
runners/ Reference test runners (Python, bash)

Quick start#

Using the Python runner#

bash
pip install jsonschema
python runners/run-tests.py

Using the bash runner#

The bash runner works with any validator that accepts a file path and outputs JSON with a valid field:

bash
chmod +x runners/run-tests.sh
./runners/run-tests.sh "inherit validate --json"

Invalid fixture catalogue#

Each invalid fixture targets a specific validation rule:

File What it tests
estate/invalid/missing-required-fields.json Missing estate and people required fields
estate/invalid/wrong-type-people.json people is a string instead of an array
estate/invalid/bad-uuid.json id and testatorPersonId are not valid UUIDs
estate/invalid/invalid-enum.json status is not a recognised enum value
estate/invalid/extra-property-name.json Top-level property name violates propertyNames pattern
estate/invalid/invalid-extension-values.json Hindu succession extension has invalid enum value (school: "invalid_school"). Level 1 valid — extension-level invalid when x-inherit-hindu-succession schema is loaded
estate/invalid/missing-extension-required.json US estate extension missing required propertyId in homesteadExemptions. Level 1 valid — extension-level invalid when x-inherit-us-estate schema is loaded
catalogue/invalid/missing-assets.json Missing required assets field
catalogue/invalid/assets-wrong-type.json assets is a string instead of an array

Extension-level fixtures#

Some fixtures in estate/invalid/ are Level 1 valid (they pass the base bundled schema) but contain errors that only surface when the relevant extension schema is also loaded. These have "valid": true in their expected results because the conformance kit ships only the base schema. The note field describes the extension-level error.

If your validator loads extension schemas alongside the base schema, these fixtures should fail. If it validates against the base schema only, they should pass.

Expected result format#

Each .expected.json contains:

json
{ "valid": true, "schemaMode": "estate" }

or for invalid documents:

json
{ "valid": false, "schemaMode": "estate", "minErrors": 1 }

Your validator must return a JSON object with at least a valid boolean field. The minErrors field is advisory — use it to verify your validator produces specific errors, not just the right boolean.

Building your own runner#

Read manifest.json to enumerate all tests. For each entry:

  1. Load the document at file
  2. Validate it using your implementation
  3. Load the expected result at expected
  4. Assert result.valid === expected.valid

Example: Node.js runner#

javascript
import { readFileSync } from 'node:fs';

const manifest = JSON.parse(readFileSync('manifest.json', 'utf-8'));
let passed = 0;
let failed = 0;

for (const test of manifest.tests) {
  const doc = JSON.parse(readFileSync(test.file, 'utf-8'));
  const expected = JSON.parse(readFileSync(test.expected, 'utf-8'));

  const result = yourValidator(doc);

  if (result.valid === expected.valid) {
    passed++;
  } else {
    failed++;
    console.error(`FAIL: ${test.file} — expected valid=${expected.valid}, got ${result.valid}`);
  }
}

console.log(`${passed} passed, ${failed} failed`);

Coverage#

The test fixtures cover:

  • Valid and invalid estate documents across multiple jurisdictions (England, Scotland, New York, Singapore, Dubai)
  • Multi-currency and multi-script name support
  • Religious succession rules (Islamic, Hindu, Jewish)
  • Referential integrity validation (Level 2)
  • Extension data validation
  • Catalogue documents (asset-only mode)

Known lint false positives#

Running jsonschema lint against the bundled schemas produces orphan_definitions warnings. These are false positives — the lint tool cannot resolve #-fragment references across $id boundaries in bundled schemas. Validators resolve them correctly at runtime. Suppress with --exclude orphan_definitions when linting bundled schemas.

Get in touch

Have a question about INHERIT, or interested in becoming a partner? We'd love to hear from you.

By submitting this form, you agree to our Privacy Policy. Your data is processed by Formspark (EU) and retained until your enquiry is resolved.

or email hello@openinherit.org