You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why does this code give me error, but the moment I remove this statement, it works fine. Why is that so? const accounts = await ethers.getSigners()
Can someone please tell me why is that so?
describe("withdraw",asyncfunction(){constaccounts=awaitethers.getSigners()beforeEach(asyncfunction(){// this must have some balance on this before extractingawaitfundMe.fund({value: sendValue})})it("withdraw only with a single funder",asyncfunction(){// we use provider.getBalance(<kiska lena hai>) to get their balance// Arrangeconstaccounts=awaitethers.getSigners()conststartingFundMeBalance=awaitfundMe.provider.getBalance(fundMe.address)conststartingDeployerBalance=awaitfundMe.provider.getBalance(deployer)
This was the error I received: "before each" hook for "withdraw only with a single funder": TypeError: Cannot read properties of undefined (reading 'fund') at Context.<anonymous> (test/unit/FundMe.test.js:57:24) at processImmediate (node:internal/timers:466:21)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Why does this code give me error, but the moment I remove this statement, it works fine. Why is that so?
const accounts = await ethers.getSigners()
Can someone please tell me why is that so?
This was the error I received:
"before each" hook for "withdraw only with a single funder":
TypeError: Cannot read properties of undefined (reading 'fund')
at Context.<anonymous> (test/unit/FundMe.test.js:57:24)
at processImmediate (node:internal/timers:466:21)
Beta Was this translation helpful? Give feedback.
All reactions