Lesson 7 fund test error #4752
Answered
by
deepak2301
deepak2301
asked this question in
Q&A
-
getting this error
const {
developments,
ethers,
deployments,
getNamedAccounts,
} = require("hardhat")
describe("FundMe", async function () {
let fundMe
let deployer
let mockV3aggregator
let FundMe
beforeEach(async function () {
//deploy our fundMe contract
//using hardhat-deploy
//? How to use diffrent accounts for deployer
//* const accounts = await sthers.getSigners()
//* const accountZero = sccount []
deployer = (await getNamedAccounts()).deployer
await deployments.fixture(["all"])
fundMe = await ethers.getContract("FundMe", deployer)
mockV3aggregator = await ethers.getContract(
"MockV3Aggregator",
deployer
)
})
describe("constructor", async function () {
it("sets the aggregator address correctly", async function () {
const response = await fundMe.priceFeed()
assert.equal(response, mockV3aggregator.address)
})
})
describe("fund", async function () {
it("Fails if you dont have enough eth", async function () {
await expect(fundMe.fund()).to.be.revertedWith(
"You don't have enough eth"
)
})
})
}) |
Beta Was this translation helpful? Give feedback.
Answered by
deepak2301
Feb 6, 2023
Replies: 1 comment 1 reply
-
error fixed sorry |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
alymurtazamemon
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
error fixed sorry