You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 17, 2024. It is now read-only.
But doing so fails with the following error message:
TypeError: Cannot read properties of undefined (reading 'waitForTransaction')
at Object.waitForPendingTransaction (node_modules/@ethereum-waffle/chai/dist/cjs/matchers/misc/transaction.js:18:21)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at runNextTicks (node:internal/process/task_queues:65:3)
at listOnTimeout (node:internal/timers:528:9)
at processTimers (node:internal/timers:502:7)
at Context.<anonymous> (test/unit/NftMarketplace.test.js:27:19)
Does anyone know why this is failing and how we could get a working code for listening for events?
The text was updated successfully, but these errors were encountered:
it("emits an event after listing an item",async()=>{awaitexpect(nftMarketplace.listItem(basicNft.address,TOKEN_ID,PRICE)).to.emit(nftMarketplace,"ItemListed")})
I noticed an issue in the unit tests. The following syntax is used:
This seems to be incorrect. I can type anything for the event name and the test will pass. E.g.:
Reading the chai docs it seems the "await" needs to be in front of the "expect" like this:
But doing so fails with the following error message:
Does anyone know why this is failing and how we could get a working code for listening for events?
The text was updated successfully, but these errors were encountered: