TypeError: Cannot read properties of undefined (reading 'JsonRpcProvider') #6686
Replies: 2 comments 4 replies
-
|
This |
Beta Was this translation helpful? Give feedback.
-
|
I got this $ yarn hardhat test 0 passing (51ms) Done in 9.21s. HP FOLIO@EddiePumpin MINGW64 ~/.vscode/hardhat-fund-me-fcc (main) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
const { deployments, ethers, getNamedAccounts } = require("hardhat") const { assert } = require("chai") describe("FundMe", async function () { let fundMe let deployer let mockV3Aggregator beforeEach(async function () { // deploy our fundme contract using Hardhat deploy const deployer = await getNamedAccounts() // deployer = (await getNamedAccounts()).deployer await deployments.fixture(["all"]) // 'fixture' allows us to run the entire deploy folder as many tags as we want fundMe = await ethers.getContact("FundMe", deployer) // getContract get the most recent deployment of whatever contract we tell it. mockV3Aggregator = await ethers.getContract( "MockV3Aggregator", deployer, ) }) // describe("constructor", function () { it("sets the aggregator addresses correctly", async function () { const response = await fundMe.getpriceFeed() assert.equal(response, mockV3Aggregator.address) }) }) })I got this error message() TypeError: Cannot read properties of undefined (reading 'JsonRpcProvider') when trying to test these lines of code.
Beta Was this translation helpful? Give feedback.
All reactions