LESSON 7 ERROR IN TESTING Error: could not decode result data (value="0x", info={ "method": "getPriceFeed", "signature": "getPriceFeed()" }, code=BAD_DATA, version=6.6.7) #176
testing the first test of the constructor and getting following error
Error: could not decode result data (value="0x", info={ "method": "getPriceFeed", "signature": "getPriceFeed()" }, code=BAD_DATA, version=6.6.7)
here is my test-fundme.js
`const { assert } = require("chai")
const { deployments, ethers, getNamedAccounts } = require("hardhat")
//const { deployer } = getNamedAccounts()
describe("FundMe", async function () {
//anonymous function
let fundMe
let mockV3Aggregator
beforeEach(async function () {
//this is created to first deploy our contract
//using hardhat funme deploy
deployer = (await getNamedAccounts()).deployer
await deployments.fixture(["all"]) // it helps to deploy all contract and scripts in one go on local host
fundMe = await ethers.getContractAt("FundMe", deployer) //get most recent deployed contract wrapped with hardhar ethers
mockV3Aggregator = await ethers.getContractAt(
"MockV3Aggregator",
deployer
)
})
describe("constructor", async function () {
it("sets the aggregator addresses correctly", async () => {
const response = await fundMe.getPriceFeed()
assert.equal(response, mockV3Aggregator.target)
})
})
testing the first test of the constructor and getting following error
Error: could not decode result data (value="0x", info={ "method": "getPriceFeed", "signature": "getPriceFeed()" }, code=BAD_DATA, version=6.6.7)
here is my test-fundme.js
`const { assert } = require("chai") const { deployments, ethers, getNamedAccounts } = require("hardhat") //const { deployer } = getNamedAccounts() describe("FundMe", async function () { //anonymous function let fundMe let mockV3Aggregator
}) `