Skip to content

Commit

Permalink
🕠 Add migration guide about time based tests (#682)
Browse files Browse the repository at this point in the history
  • Loading branch information
rzadp committed Mar 30, 2022
1 parent 44c6042 commit 402a6b8
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/source/migration-guides.rst
Original file line number Diff line number Diff line change
Expand Up @@ -369,3 +369,17 @@ We stopped supporting :code:`@ethereum-waffle/jest`. From now on the package is
* - :code:`.toBeRevertedWith(revertReason)`
- :code:`.to.be.revertedWith(reason)`

Time-based tests
~~~~~~~~~~~~~~~~

If your tests rely on manually setting timestamp on the blockchain using `evm_mine`, you need to use `evm_setTime` alongside.

For example:

.. code-block:: diff
export async function mineBlock(provider: providers.Web3Provider, timestamp: number) {
+provider.send('evm_setTime', [timestamp * 1000])
await provider.send('evm_mine', [timestamp])
}

0 comments on commit 402a6b8

Please sign in to comment.