Testing standards

Use this page when you need to decide which tests and validation evidence a tax behaviour change needs.

Required evidence by change

ChangeRequired evidence
Factschema decode tests, graph validation, type tests if public input types change
Rulesource reference validation, graph checks, golden tests, trace snapshots when rule IDs or ledgers change
Calculatorschema tests, golden tests, graph validation, API compatibility tests and SDK compatibility tests
Tax yearparameter schema validation, effective-date checks, golden tests, API metadata tests and SDK type tests
Incorrect resultfailing regression first, source citation, passing golden test and compatibility notes

Test types

Golden tests should use official examples or reviewed scenarios and live with the rule package they validate.

Type tests should prove public SDK descriptors reject unsupported facts, calculator IDs, jurisdictions and tax years at compile time.

API compatibility tests should prove CalculatorRunRequest, CalculatorRunResponse and route-owned error envelopes still match public HTTP expectations.

SDK compatibility tests should prove TaxKit.calculate, TaxKit.safe.calculate, calculateRunRequest, calculateReportRequest, calculateReport and jurisdiction helpers still infer the expected input, report and error types.

Commands

Use package-specific commands when your change is local:

sh
bun run --filter=@taxkit/rules-au-pay test
bun run --filter=@taxkit/rules-au-income-tax test
bun run --filter=@taxkit/rules-au-stsl test
bun run --filter=@taxkit/calculators test
bun run --filter=@taxkit/api-http test
bun run --filter=@taxkit/sdk test-types

Before handoff, run the repository gate:

sh
bun run verification

Source of truth

For the full quality model, read Testing and quality and Testing and validation.