Open Tuafo opened 1 year ago
Navigate to the GitHub repository at https://github.com/PatrickAlphaC/hardhat-fund-me-fcc/blob/main. Find the hardhat.config.js file, copy its requires, and then replace the corresponding sections in your local hardhat.config.js file.
In the same GitHub repository, locate the package.json file, copy its contents, and replace the content in your local package.json file.
After updating your configuration and package files, you should delete your local node_modules directory to remove potentially conflicting dependencies.
npm i --force
The problem i've been experiencing appears to be related to dependency conflicts. Following these steps should help resolve the issue.
Remember to follow all the instructions in the specified order. If you encounter any problems, please don't hesitate to ask for assistance.
I'll let this issue open in case someone need him
Hello i noticd using .target dets the address of the contract, while .address gets the adrress where the code is been deployed. You can try the following below
describe("constructor", async function () {
it("sets the aggregator addresses correctly", async () => {
const response = await fundMe.priceFeed()
assert.equal(response, mockV3Aggregator.target)
})
})
Hello, this is the code i used in solving the issue
const { assert } = require("chai")
const { deployments, ethers } = require("hardhat")
describe("Fund Me Contract Test", async () => {
let fundMe
let mockV3Aggregator
beforeEach(async () => {
// deploy all contracts
await deployments.fixture(["all"])
fundMe = await deployments.get("FundMe")
mockV3Aggregator = await deployments.get("MockV3Aggregator")
fundMe = await ethers.getContractAt(fundMe.abi, fundMe.address)
mockV3Aggregator = await ethers.getContractAt(
mockV3Aggregator.abi,
mockV3Aggregator.address
)
})
describe("constructor", async () => {
it("should set aggregator addresses correctly", async () => {
const response = await fundMe.priceFeed()
assert.equal(response, mockV3Aggregator.target)
})
})
})
this is my code and it's not working, this is the following error when i run 'yarn hardhat test':
it was supossed to work, since i already have check every line of code and it's the same from the tutorial. the video link in the part of the code i'm in https://youtu.be/gyMwXuJrbJQ?t=40700