Skip to content

Code on the FundMe.test.js #512

Answered by technophile-04
igrs08 asked this question in Q&A
Discussion options

You must be logged in to vote

const transactionReceipt = await transactionResponse.wait(1)
The 1 here represent that you want to wait for 1 block confirmation....If you pass there 6 you are saying i want to wait for 6 block confirmation.


await expect(fundMe.getFunder(0)).to.be.reverted
In the above line, we are making sure that after the deployer has withdrawn the funds the funders array is reset and it is empty.
Above line has .to.be.reverted here we telling that fundMe.getFunder(0) this function will fail(since we have reset the array and there is no element at 0th index) and it will throw error and if it does that means its correct and it should pass the test

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@igrs08
Comment options

@technophile-04
Comment options

Answer selected by igrs08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants