Skip to content

How does "beforeEach" work / question on unit testing in lesson 7 (~11 hours 24 minutes in) #1674

Answered by alymurtazamemon
tmcdonough asked this question in Q&A
Discussion options

You must be logged in to vote

@tmcdonough No, you are confusing here, each function runs a new copy you can say until you do not have beforeEach.

Here you have only 1 beforeEach that deploys and gets the instance of the FundMe contract, after that it behaves that there is no account 0 amount funded to contract.

Your first test is correct but for the second you need to compare it with funders(0).

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
4 replies
@tmcdonough
Comment options

@alymurtazamemon
Comment options

@tmcdonough
Comment options

@alymurtazamemon
Comment options

Answer selected by alymurtazamemon
Comment options

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

@krakxn
Comment options

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