Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getFund单元测试金额不对 #34

Open
dawn21810 opened this issue Dec 26, 2024 · 0 comments
Open

getFund单元测试金额不对 #34

dawn21810 opened this issue Dec 26, 2024 · 0 comments

Comments

@dawn21810
Copy link

我的本地运行getFund函数测试时,时不时提示金额不对,按照金额推断应该是上个场景测试影响到了,但是找不到原因,有谁知道大概是哪方面的问题
` it("window close,target not reached, getFund faild",
async function () {
await fundMe.fund({ value: ethers.parseEther("0.1") })
//make sure the window is closed
await helpers.time.increase(200)
await helpers.mine()
await expect(fundMe.getFund())
.to.be.revertedWith("target not reached")
}
)

//提示金额不对
it("window close,target reached, getFund success",
async function () {
await fundMe.fund({ value: ethers.parseEther("1") })
//make sure the window is closed
await helpers.time.increase(200)
await helpers.mine()
await expect(fundMe.getFund())
.to.emit(fundMe, "FundWithdrawByOwner")
.withArgs(ethers.parseEther("1"))
}
)`

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant