Replies: 2 comments 1 reply
-
it seems everything is ok. Could you show your hardhat config, especially |
Beta Was this translation helpful? Give feedback.
1 reply
-
@devcaii Use custom errors like this; await expect(fundMeConnectedContract.withdraw()).to.be.revertedWithCustomError(fundMe, "FundMe__NotOwner"); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When attempting to test my custom error, it throws me an assertion error, however when i run it outside of the expect function it tells me that it throws my custom error
Error when running the expect function and testing the error
Error when i run without the except and just try to withdraw regularly
I'm not sure why It's not working if it is throwing the correct error, if anyone could offer some insight into this it would be greatly appreciated, below I'll include my FundMe.sol, deploy.js and my FundMe.test.js
FundMe.test.js
FundMe.sol
deploy-fund-me.js
sorry in advance if my code is hard to read
Beta Was this translation helpful? Give feedback.
All reactions