I have a function that requires 7 days to pass from the time of an event (lockTime) before the rest of it will execute:
function resetGame () public onlyOwner {
require (block.timestamp >= lockTime + 7 days);
_;
}
how could I write a test using JS and chai to test that when 7 days pass, the function works as intended?
(p.s. I am using Hardhart and ethers.js)
Best Answer
You can use
evm_increaseTime
rpc available in Hardhat Network (docs).