Hey guys i am unable to run me test please help. #5375
-
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 3 replies
-
@PUNEETSHEKHAR15 Leave your repo link instead I need to see other things in order to confirm the issue. |
Beta Was this translation helpful? Give feedback.
-
@alymurtazamemon github repo - https://github.com/PUNEETSHEKHAR15/hardhat-fundme.git const { deployments, ethers, getNamedAccounts }=require("hardhat");
const { assert } = require("chai")
describe("FundMe", function () {
let fundMe
let mockV3Aggregator
let deployer
beforeEach(async () => {
// const accounts = await ethers.getSigners()
// deployer = accounts[0]
deployer = (await getNamedAccounts()).deployer
await deployments.fixture(["all"])
fundMe = await ethers.getContractAt("FundMe", deployer)
mockV3Aggregator = await ethers.getContractAt(
"MockV3Aggregator",
deployer
)
})
describe("constructor", function () {
it("sets the aggregator addresses correctly", async () => {
const response = await fundMe.priceFeed()
assert.equal(response, mockV3Aggregator.address)
})
})
}) |
Beta Was this translation helpful? Give feedback.
-
@alymurtazamemon |
Beta Was this translation helpful? Give feedback.
-
@alymurtazamemon please run it locally , check the error why first (constructor test is not passing ) |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
@PUNEETSHEKHAR15 You did not have ethers from
hardhat-deploy
dependency due to that it were givingethers.getContract function not found
error becausegetContract
is the function ofhardhat-deploy
dependency.Also you should now use toolbox dependency with hardhat not the old hardhat-waffle. Change this in hardhat-config.js file.
Also update your test;