Skip to content

Testing

Cursor Agent edited this page Apr 9, 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 also runs npm run verify-package after codegen: verify-package-imports, verify-merged-lib (required bundled files, no Nft/Reference→root index cycle, require('./lib/index.js'), root OCP_TEMPLATES, subpath openCapTableDarPath, and no DAR helpers on the root index—browser/Next safety), test:imports (asserts OCP_TEMPLATES.capTable, issuerAuthorization, and ocpFactory). See DAR path resolution on Home for resolveOpenCapTableDarPath / OPEN_CAP_TABLE_DAR_PATH.

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 are organized by package and live in the Test/ directory. They use DAML Script for end-to-end testing of contract interactions (including NFT registry flows where covered by Test/daml/).

Test/daml.yaml data-dependencies include equity certificate DARs; equity coverage lives under Test/daml/Fairmint/EquityCertificate/.

Clone this wiki locally