AssertionError: Expected transaction to be reverted with reason 'FundMe__NotOWner', but it didn't revert #2526
-
Hey, please I am getting an error with my FundMe .test.js The error is: AssertionError: Expected transaction to be reverted with reason 'FundMe__NotOWner', but it didn't revert Here is the code: it("Only allows the owner o withdraw", async function () {
const accounts = await ethers.getSigners()
const attacker = accounts[1]
const attackerConnectedContract = await fundMe.connect(attacker)
await expect(
attackerConnectedContract.withdraw()
).to.be.revertedWith("FundMe__NotOWner")
}) Please help if you can |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 20 replies
-
What account did you use to deploy your contract? |
Beta Was this translation helpful? Give feedback.
-
@blaynejosh : Can you send me your FundMe contract! |
Beta Was this translation helpful? Give feedback.
-
Hey @blaynejosh please make your
Lack of |
Beta Was this translation helpful? Give feedback.
-
Is this resolved yet? If not, push to GitHub and I will look into it :) |
Beta Was this translation helpful? Give feedback.
-
@blaynejosh : Made PRs in your repo, You can merge them! And let me know, If it resolves your issue! |
Beta Was this translation helpful? Give feedback.
-
Hey @blaynejosh I've made a PR that may fix your issue. Please check it out. |
Beta Was this translation helpful? Give feedback.
@blaynejosh : Can you send me your FundMe contract!