Im getting the assertion error image

the test

it("return false if enough time hasnt passed", async function(){
                await expect(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([])
                assert.equal(upkeepNeeded, false)

and also my test case is passing if I remove the line await network.provider.request({ method: "evm_mine",params: []}) only getting error if the line is present


1 Answer 1


I had the same assertion error. When I checked the main Raffle.sol contract, I saw that I didn't set the s_lastTimeStamp variable in the constructor. So make sure you set the s_lastTimeStamp variable in the constructor like this: setting s_lastTimeStamp in constructor

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.