When doing unit test on fund function of FundMe contract, the test is throwing exception
Seems to be issue with revertedWith function
Test code :
describe("fund", () => {
it("fails if you don't send enough ETH", async () => {
await expect(fundMe.fund()).to.be.revertedWith(
"You need to spend more ETH"
)
})
})
The test has to be passed with a tick mark but it's throwing following exception:
AssertionError: Expected transaction to be reverted with You need to spend more ETH, but other exception was thrown: Error: VM Exception while processing transaction: reverted with reason string 'Didn't send enough!
When doing unit test on fund function of FundMe contract, the test is throwing exception Seems to be issue with revertedWith function
Test code :
The test has to be passed with a tick mark but it's throwing following exception:
AssertionError: Expected transaction to be reverted with You need to spend more ETH, but other exception was thrown: Error: VM Exception while processing transaction: reverted with reason string 'Didn't send enough!
Can anyone help with this? Thanks