LESSON 07 | TypeError: ethers.getContract is not a function #4743
Answered
by
alymurtazamemon
Umairulislam
asked this question in
Q&A
-
I'm running the following command to test my contract
and gets the following error
This my code const { deployments, getNamedAccounts, network } = require("hardhat")
const { assert, expect } = require("chai")
const { ethers } = require("ethers")
const { developmentChains } = require("../../helper-hardhat-config")
describe("FundMe", function () {
let fundMe
let mockV3Aggregator
let deployer
beforeEach(async () => {
deployer = (await getNamedAccounts()).deployer
await deployments.fixture(["all"])
fundMe = await ethers.getContract("FundMe", deployer)
mockV3Aggregator = await ethers.getContract(
"MockV3Aggregator",
deployer
)
})
describe("constructor", function () {
it("sets the aggregator addresses correctly", async () => {
const response = await fundMe.getPriceFeed()
assert.equal(response, mockV3Aggregator.address)
})
})
}) |
Beta Was this translation helpful? Give feedback.
Answered by
alymurtazamemon
Feb 6, 2023
Replies: 1 comment
-
@Umairulislam I have answered this here #4710 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
alymurtazamemon
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@Umairulislam I have answered this here #4710