smartcontractkit / full-blockchain-solidity-course-js

Learn Blockchain, Solidity, and Full Stack Web3 Development with Javascript
12.4k stars 2.98k forks source link

Error: No Contract deployed with name FundMe #5099

Closed Crawlling closed 1 year ago

Crawlling commented 1 year ago

Lesson

Lesson 9

Could you please leave a link to the timestamp in the video where this error occurs? (You can right click a video and "copy video URL at current time")

https://youtu.be/gyMwXuJrbJQ?t=40609

Operating System

Windows

Describe the bug

const { deployments, ethers, getNamedAccounts } = require("hardhat") const { assert } = require("chai")

describe("FundMe", async function () { let fundme let deployer let MockV3Aggregator

beforeEach(async () => {
    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("set the aggregator addresses correctly", async function () {
        const response = await fundme.priceFeed()

        assert.equal(response, MockV3Aggregator.address)
    })
})

})

error here: yarn run v1.22.19 warning package.json: No license field $ /root/folder/hardhat-fundme/node_modules/.bin/hardhat test WARNING: You are using a version of Node.js that is not supported, and it may work incorrectly, or not work at all. See https://hardhat.org/nodejs-versions

FundMe constructor 1) "before each" hook for "set the aggregator addresses correctly"

0 passing (574ms) 1 failing

1) FundMe "before each" hook for "set the aggregator addresses correctly": Error: No Contract deployed with name FundMe at Object.getContract (node_modules/@nomiclabs/hardhat-ethers/src/internal/helpers.ts:447:11) at processTicksAndRejections (node:internal/process/task_queues:95:5) at Context. (test/unit/FundMe.test.js:12:18)

error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

thanks for your time

alymurtazamemon commented 1 year ago

@Crawlling This is not a course-related issue instead it is your code-related issue for that please come to the discussions tab where many contributors are active to help. I am closing this issue and see you in the discussions tab.

closing #5099