0 passing in performupkeep tests #5493
-
describe("performUpkeep", function () {
it("it can only run if checkupkeep is true", async function () {
await raffle.enterRaffle({ value: raffleEntranceFee })
await network.provider.send("evm_increaseTime", [interval.toNumber() + 1])
await network.provider.request({ method: "evm_mine", params: [] })
const tx = await raffle.performUpkeep("0x")
assert(tx)
})
it("reverts if checkup is false", async () => {
await expect(raffle.performUpkeep("0x")).to.be.revertedWith(
"Raffle__UpkeepNotNeeded"
)
})
}) |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
Could you show all your test code? |
Beta Was this translation helpful? Give feedback.
-
I don't see describe("performUpkeep", function () { |
Beta Was this translation helpful? Give feedback.
-
@Sanyam2103 You must have some typo in |
Beta Was this translation helpful? Give feedback.
-
@Sanyam2103 you forgot to close the }) the describe function of checkUpkeep |
Beta Was this translation helpful? Give feedback.
@Sanyam2103
it("returns true if enough time has passed, has players, eth, and is open", async () => {
await raffle.enterRaffle({ value: raffleEntranceFee })
await network.provider.send("evm_increaseTime", [interval.toNumber() + 1])
await network.provider.request({ method: "evm_mine", params: [] })
const { upKeepNeeded } = await raffle.callStatic.checkUpkeep("0x") // upkeepNeeded = (timePassed && isOpen && hasBalance && hasPlayers)
assert(upKeepNeeded)
})
}) (add this............................)
you forgot to close the }) the describe function of checkUpkeep