The project includes both Solidity contract tests (using Foundry) and frontend tests (using Vitest).
Foundry tests are written in Solidity and live alongside the contracts in the contracts/test/ directory.
make test-contracts
| File | Tests |
|---|---|
| MockERC20.t.sol | Minting, only-faucet restriction, setFaucet, events, ownership transfer |
| Faucet.t.sol | Claim mETH, claim mBTC, 24h cooldown, time-remaining, lifetime tracking, double-claim revert, onlyOwner setters |
| MockDEX.t.sol | Add liquidity, swap mETH→mUSDC, swap mUSDC→mETH, slippage protection, rate updates, insufficient liquidity, fuzz tests with bound() |
make coverage
Generates an LCOV coverage report showing line-by-line coverage of all contracts.
Frontend tests use Vitest and React Testing Library. Test files live in frontend/tests/.
make test-frontend
make test
This runs both contract tests and frontend tests sequentially.