import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"
import { assert, expect } from "chai"
import { network, deployments, ethers } from "hardhat"
import { developmentChains } from "../../helper-hardhat-config"
import { FundMe, MockV3Aggregator } from "../../typechain-types"
describe("FundMe", function () {
let fundMe: FundMe
let mockV3Aggregator: MockV3Aggregator
let deployer: SignerWithAddress
beforeEach(async () => {
if (!developmentChains.includes(network.name)) {
throw "You need to be on a development chain to run tests"
}
const accounts = await ethers.getSigners()
deployer = accounts[0]
await deployments.fixture(["all"])
fundMe = await ethers.getContract("FundMe")
mockV3Aggregator = await ethers.getContract("MockV3Aggregator")
})
if you import ethers like this in typescript, getContract function is not available there anymore. What else we can do? @PatrickAlphaC
It should be... make sure that your hardhat.config.js has everything you need like require("@nomiclabs/hardhat-waffle") and you've installed hardhat-deploy.
if you import ethers like this in typescript, getContract function is not available there anymore. What else we can do? @PatrickAlphaC