This document provides top-level information to agents (Claude Code etc.). It is loaded into context automatically for all sessions in this repo, so keep it concise!
All Cadence test files are located in:
cadence/tests/*_test.cdc
On a fresh clone, you MUST init submodules and install Flow dependencies before running tests:
git submodule update --init --recursive
flow deps install./run_tests.shTo run a specific test file:
flow test <path/to/test_file.cdc>Example:
flow test cadence/tests/liquidation_phase1_test.cdcIMPORTANT: To run a specific test function by name, you must specify the file path:
flow test <path/to/test_file.cdc> --name <test_function_name>Example:
# Run a specific test from a multi-test file
flow test cadence/tests/interest_accrual_integration_test.cdc --name test_combined_all_interest_scenariosgrep "fun test" cadence/tests/interest_accrual_integration_test.cdc- Use string templating, not concatenation:
"Hello \(name)"not"Hello ".concat(name) - Use
equalWithinVariancefromtest_helpers.cdcfor equality assertions where rounding errors are possible - Use red-green TDD for bug fixes and extensions to functionality. Tests must use assertions (eg.
Test.assert) to verify expected behaviour, not logs.