# Run all EVM tests (Foundry + Hardhat)yarn test-evm# Run only Foundry tests (recommended)yarn test-evm-foundry# Run only Hardhat tests (legacy)yarn test-evm-hardhat
# Run specific test contractFOUNDRY_PROFILE=local-test forge test --match-contract HubPool_AdminTest# Run specific test functionFOUNDRY_PROFILE=local-test forge test --match-test testDeposit# Run with verbose outputFOUNDRY_PROFILE=local-test forge test -vvv# Run with gas reportingFOUNDRY_PROFILE=local-test forge test --gas-report
Tests that run against forked mainnet/testnet state. Useful for validating cross-chain behavior.
# Fork tests are in test/evm/foundry/fork/# Run with specific network RPCforge test --fork-url $NODE_URL_1 --match-path "test/evm/foundry/fork/**/*.sol"
The project uses Foundry profiles defined in foundry.toml:
default: Standard build configuration
local-test: Optimized for local unit tests (skips fork tests)
zksync: ZKSync-specific compilation
Always use FOUNDRY_PROFILE=local-test for local Foundry tests. Running forge test without this profile may include fork tests that require network access.
export NODE_URL_1=https://mainnet.infura.com/v3/YOUR_KEYexport NODE_URL_42161=https://arbitrum-mainnet.infura.com/v3/YOUR_KEY# ... see foundry.toml for all available endpoints