Lesson 7 Staging Scripts #549
-
I am trying to run the Fundme.staging.test.js on rinkeby FundMe.test.js const { inputToConfig } = require("@ethereum-waffle/compiler")
const { getNamedAccounts, ethers, network } = require("hardhat")
const { developmentChains } = require("../../helper-hardhat-config")
const { assert } = require("chai")
developmentChains.includes(network.name)
? describe.skip
: describe("FundMe", async function () {
let fundMe
let deployer
const sendValue = ethers.utils.parseEther("1")
beforeEach(async function () {
deployer = (await getNamedAccounts()).deployer
fundMe = await ethers.getContract("FundMe", deployer)
})
it("allows people to fund and withdraw", async function () {
await fundMe.fund({ value: sendValue })
await fundMe.withdraw()
const endingBalance = await fundMe.provider.getBalance(
fundMe.address
)
assert.equal(endingBalance.toString(), "0")
})
}) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
@armontej Mention the error/issue. |
Beta Was this translation helpful? Give feedback.
-
What's the point of these lines, if we need to add eth to our account to fund the funds contract. I thought the test was doing it with these lines? Can someone please explain? I'm running into the same error but I thought it wouldn't matter since we're funding 1eth not from our account but the test, if thats not the case can you explain what these two lines below do? const sendValue = ethers.utils.parseEther("1")
await fundMe.fund({ value: sendValue }) |
Beta Was this translation helpful? Give feedback.
@armontej Mention the error/issue.