Open haris4121 opened 1 year ago
after writing test
it("only allows owner to withdraw", async () => { const accounts = await ethers.getSigners() const fundMeConnectedContract = await fundMe.connect(accounts[1]) await expect(fundMeConnectedContract.withdraw()).to.be.revertedWith( "FundMe__NotOwner" ) })
it gives error as
AssertionError: Expected transaction to be reverted with reason 'FundMe__NotOwner', but it reverted with a custom error
but if i write test with out revert messege it passes
it("only allows owner to withdraw", async () => { const accounts = await ethers.getSigners() const fundMeConnectedContract = await fundMe.connect(accounts[1]) await expect(fundMeConnectedContract.withdraw()).to.be.reverted })
I'm having the same issue, running the typescript version, thinking it could be a typing issue?
Answer is here @haris4121:
https://github.com/PatrickAlphaC/hardhat-fund-me-fcc/issues/130
after writing test
it gives error as
but if i write test with out revert messege it passes