Skip to content

Lesson 7: Unit testing is failing #5988

Answered by alfaqi
Astronaut828 asked this question in Q&A
Discussion options

You must be logged in to vote
  • first import this line into hardhat.config.js file
require("@nomiclabs/hardhat-ethers")
  • instead using getContractAt() use getContract(),
        fundMe = await ethers.getContract("FundMe", deployer) 
        mockV3Aggregator = await ethers.getContract("MockV3Aggregator", deployer)
  • you have typo, you have more )
        it("Adds funder to array of funders"),

after modification

        it("Adds funder to array of funders", async function () {
            await fundMe.fund({ value: sendValue })
            const funder = await fundMe.funders(0)
            assert.equal(funder, deployer)
        })
  • instead using fundMe.provider use ethers.provider
    like this
    const startingFundMeBal…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Astronaut828
Comment options

Answer selected by Astronaut828
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants