Skip to content

Testing

Cursor Agent edited this page Jun 16, 2026 · 13 revisions

Open Cap Table Protocol Test Suite

DAML Script tests live in Test/ at the repo root. Run them with npm run test from the repository root (not from Test/ alone).

CI (after npm run build):

  • npm run check-upgrade-compat — runs after DAML build, before codegen
  • npm run codegen then npm run verify-package:
    • verify-package-imports
    • verify-merged-lib — required bundled files, require('./lib/index.js'), root OCP_TEMPLATES, subpath openCapTableDarPath, no Nft / CantonPayments on root index, no DAR helpers on root
    • test:imports

See DAR path resolution on Home for resolveOpenCapTableDarPath / OPEN_CAP_TABLE_DAR_PATH. Verification scripts for other Fairmint packages live with fairmint/daml or downstream repos — not in this CI workflow.

Test Requirements

  • External template choices should be 100% covered. External templates created may be less than 100% due to external dependencies.
    • This requires a test of the Archive command which is implicitly available on all templates.
  • When Optional fields are included, the test file should include at least 2 separate tests, one with None for all Optional fields and another with Some for all Optional fields.

Running Tests

# From the root directory
npm run test

Tests live under Test/daml/ (DAML Script). Test/daml.yaml depends on the built OpenCapTable-v34 DAR only (see data-dependencies). Cross-package integration with DAML maintained in fairmint/daml belongs in that repo or in consumer test suites — not in this tree.

Clone this wiki locally