Lesson 7 error : "before each" hook for "should set the aggregator address correctly": TypeError: ethers.getContract is not a function #6483
Unanswered
wbshobhit1
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Here is the correct version
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
`const { assert } = require("chai");
const { getNamedAccounts, deployments, ethers } = require("hardhat");
describe("FundMe", async function () {
let fundMe;
let deployer;
let mockV3Aggregator;
beforeEach(async function () {
// const accounts = await ethers.getSigners();
// const accountZero = accounts[0];
deployer = (await getNamedAccounts()).deployer;
await deployments.fixture(["all"]);
fundMe = await ethers.getContract("FundMe", deployer);
mockV3Aggregator = await ethers.getContract(
"MockV3Aggregator",
deployer,
);
});
});
`
I am getting this error "TypeError: ethers.getContract is not a function"
i have tried all the possible solution present on the StackOverflow and ethetruem stack solution no solution seems to work.
Beta Was this translation helpful? Give feedback.
All reactions