You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by wbshobhit1 March 6, 2024
`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,
);
});
describe("constructor", async function () {
it("should set the aggregator address correctly", async function () {
const response = await fundMe.priceFeed();
assert.equal(response, mockV3Aggregator.target);
});
});
});
`
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.
The text was updated successfully, but these errors were encountered:
Discussed in #6483
Originally posted by wbshobhit1 March 6, 2024
`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.
The text was updated successfully, but these errors were encountered: