Testing
Key Testing Types
The framework supports three test categories:
- Unit tests - Isolated contract logic verification
- Fuzz tests - Randomized input testing
- Fork tests - Mainnet state integration tests
Essential Setup
You’ll need Foundry installed plus environment configuration. The setup requires an Ethereum RPC endpoint, with archive node access recommended for fork testing scenarios.
Running Tests
Unit tests only
With fuzz tests
Complete suite
Test Organization
Tests are structured across multiple files covering different components:
- TWAP orders
- StopLoss functionality
- Guards
- Order forwarding
Helper contracts and libraries support the test infrastructure.
Coverage Reporting
Generate reports excluding fork tests:
For detailed HTML output, use the lcov report format with genhtml:
Common Patterns
Tests inherit from BaseComposableCoWTest for access to pre-configured accounts and infrastructure. The documentation includes examples for testing:
- Reverts and error conditions
- Events
- Time-based conditions
- Gas snapshots
Last modified on March 4, 2026