OpenZeppelin Test Helpers v0.5.6

We’ve published a new release of @openzeppelin/test-helpers

It includes expectEvent.notEmitted, an enhanced version of the current expectEvent.not that will accept any transaction receipt as its argument. The previous helper has been deprecated, so you may run into the deprecation warning after upgrading.

npm install @openzeppelin/test-helpers@latest

Enjoy!

Changelog

  • Deprecated expectEvent.not in favor of expectEvent.notEmitted . (#121)
  • Added expectEvent.notEmitted() for asserting absence of events in Truffle or Web3 receipts. (#121)

How to upgrade from 0.5.5

Note: These changes are only necessary to get rid of the new deprecation warning.

  • If you have a receipt:
await expectEvent.not.inTransaction(receipt.tx, contract, event)

becomes

expectEvent.notEmitted(receipt, event)
  • If you don’t have a receipt, you can continue using inTransaction, but through notEmitted: expectEvent.not.inTransaction becomes expectEvent.notEmitted.inTransaction.
1 Like

Documentation for OpenZeppelin Test Helpers:
https://docs.openzeppelin.com/test-helpers/0.5/