smartcontractkit/full-blockchain-solidity-course-js

About the problem in Lesson 9, "Error: Timeout of 20000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. "

RMTKroos opened this issue · 1 comments

If using ethers v6,some changes are needed.
Firstly, in ethers v6, getBalance function need use provider,
Change:

const winnerStartingBalance = await accounts[0].getBalance()

To:

const winnerStartingBalance = await ethers.provider.getBalance(accounts[1].address)

furthermore, in v6, the BigNumber class has been replaced with the built-in ES2020
Change:

winnerStartingBalance.add(raffleEntryFee)

To:

winnerStartingBalance + raffleEntryFee

Originally posted by @RMTKroos in #5050 (comment)

Remove this from your hardhat.config.js:

mocha: {
timeout: 20000,
},