Testing Overview
Commands
| Goal | Command |
|---|---|
| Build contracts | make build |
| Solidity tests | make test or pnpm test |
| Verbose tests | make test-v |
| Invariants | make test-invariant |
| Deep invariants | make test-invariant-deep |
| Docs build | pnpm docs:build |
| Frontend build | pnpm app:build |
Solidity coverage
| Area | Files |
|---|---|
| Cap table setup | CapTable.t.sol, CapTableFactory.sol, Issuer.t.sol |
| Access control | AccessControl.t.sol, Wallet.t.sol |
| Stock lifecycle | StockIssuance.t.sol, StockTransfer.t.sol, StockCancellation.t.sol, StockRepurchase.t.sol, StockReissuance.t.sol, StockRetraction.t.sol, StockAcceptance.t.sol |
| Setup records | Stakeholder.t.sol, StockClass.t.sol, Minting.t.sol |
| Share adjustments | Adjustment.t.sol |
| Invariants | test/invariants/CapTableInvariants.t.sol |
Invariants
| Property | Purpose |
|---|---|
Issuer shares_issued <= shares_authorized | Prevent issuer over-issuance. |
Class shares_issued <= shares_authorized | Prevent class over-issuance. |
| Stakeholder and stock class counts stay consistent. | Catch index drift. |
| Active position tracking stays consistent. | Catch stale securities and missing deletes. |
Before a PR
| Change | Minimum check |
|---|---|
| Docs | pnpm docs:build |
| Solidity logic | make test |
| Share accounting or lifecycle | make test && make test-invariant |
| Frontend | pnpm app:build |