Skip to content

Commit

Permalink
chore: add expectemit refresher
Browse files Browse the repository at this point in the history
  • Loading branch information
Evalir committed Jul 7, 2023
1 parent 0622765 commit 9f67b28
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/migrating-to-v1/breaking-changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ contract EmitTest is Test {
// emitEvent() emits [A, B, C, D, E], and we're expecting [A, B, C, D, E].
// This passes.
function testExpectEmit() public {
// A quick refresher on `vm.expectEmit` params:
// The first three booleans indicate if you want to check `topic1`, `topic2` and `topic3`.
// `topic0` is always checked.
// The last boolean indicates if you want to check the data.
// If you want to read further, you can go to the `vm.expectEmit` reference: https://book.getfoundry.sh/cheatcodes/expect-emit?highlight=expectEmit#expectemit
vm.expectEmit(true, false, false, true);
emit A(1);
vm.expectEmit(false, false, false, true);
Expand Down

0 comments on commit 9f67b28

Please sign in to comment.