Skip to content

lesson 7: AssertionError: Expected transaction to be reverted with reason 'FundMe__NotOwner', but it reverted with a custom error #4604

Discussion options

You must be logged in to vote

@umairahmed88 Use this;

await expect(
            attackerConnectedContract.withdraw()
        ).to.be.revertedWithCustomError(fundMe, "FundMe_NotOwner");

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@umairahmed88
Comment options

@paulcoffee85
Comment options

@alymurtazamemon
Comment options

@paulcoffee85
Comment options

@masaj84
Comment options

Answer selected by umairahmed88
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants