Lesson 7: unit testing error for fund #2072
-
After I run code for the test is below: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Try this describe("fund", async function () {
it("Fails if you don't send enough ETH", async function () {
await expect(fundMe.fund()).to.be.revertedWith( "You need to spend
more ETH!" )
})
}) The problem in you code was that you didn't type the exact statement you entered in |
Beta Was this translation helpful? Give feedback.
-
describe("fund", async function () { it("Fails if you don't send enough ETH", async function () { await expect(fundMe.fund()).to.be.revertedWith( "You need to spend more ETH" ) }) }) |
Beta Was this translation helpful? Give feedback.
Try this
The problem in you code was that you didn't type the exact statement you entered in
require
statement in fundme.sol the exact statement wasYou need to spend more ETH!
and in test file you are expectingYou need to spend more ETH
which result in failure of the test.