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 ofexpectEvent.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 throughnotEmitted
:expectEvent.not.inTransaction
becomesexpectEvent.notEmitted.inTransaction
.