Skip to content

Commit

Permalink
docs: document no param expectRevert change (foundry-rs#657)
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes authored Sep 29, 2022
1 parent 1fcaff6 commit f29d8bc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/cheatcodes/expect-revert.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ This means, for example, we can call [`prank`](./prank.md) immediately before th

There are 3 signatures:

- **Without parameters**: Asserts that the next call reverts **without** a message.
- **Without parameters**: Asserts that the next call reverts, regardless of the message.
- **With `bytes4`**: Asserts that the next call reverts with the specified 4 bytes.
- **With `bytes`**: Asserts that the next call reverts with the specified bytes.

Expand Down Expand Up @@ -70,17 +70,17 @@ vm.expectRevert(
);
```

If you need to assert that a function reverts _without_ a message, you can do so with `expectRevert()`.
If you need to assert that a function reverts _without_ a message, you can do so with `expectRevert(bytes(""))`.

```solidity
function testExpectRevertNoReason() public {
Reverter reverter = new Reverter();
vm.expectRevert();
vm.expectRevert(bytes(""));
reverter.revertWithoutReason();
}
```

You can also have multiple `expectRevert()` checks in a single test.
You can also have multiple `expectRevert()` checks in a single test.

```solidity
function testMultipleExpectReverts() public {
Expand Down

0 comments on commit f29d8bc

Please sign in to comment.