diff --git a/src/reference/cheatcodes.md b/src/reference/cheatcodes.md index db6a0d1..38785e1 100644 --- a/src/reference/cheatcodes.md +++ b/src/reference/cheatcodes.md @@ -56,6 +56,7 @@ interface CheatCodes { function etch(address who, bytes calldata code) external; // Sets an address' code + function expectRevert() external; function expectRevert(bytes calldata) external; function expectRevert(bytes4) external; // Expects an error on next call @@ -376,6 +377,24 @@ An alternative version of [`expectRevert`](#expectrevert) that only takes an err cheats.expectRevert(MyContract.CustomError.selector) ``` +##### Alternative Signature without error message + +```solidity +function expectRevert() external; +``` + +If you need to test that a function reverts _without_ a message, you can do so with `expectRevert()`. + +###### Example + +```solidity +function testExpectRevertNoReason() public { + Reverter reverter = new Reverter(); + cheats.expectRevert(); + reverter.revertWithoutReason(); +} +``` +
---