Testing Smart Contracts
1
Write test definitions
Write test definitions inside the
/test directory, for example, test/HelloWorld.t.sol.2
Run tests
Run the tests by running the following command:
Cheatcodes
Cheatcodes allow you to manipulate the state of the blockchain during testing, allowing you to change the block number, your identity, and more.Foundry Cheatcode Reference
Reference for all cheatcodes available in Foundry.