Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checks of events emissions are not working well in tests due to wrong use of chai matchers #823

Closed
miguelmtzinf opened this issue Mar 7, 2023 · 0 comments · Fixed by #824
Assignees

Comments

@miguelmtzinf
Copy link
Contributor

This is an example of a chai matcher not working well, because it is not checking the event emissions.

expect(
await aaveOracle
.connect(poolAdmin.signer)
.setAssetSources([mockToken.address], [mockAggregator.address])
)
.to.emit(aaveOracle, 'AssetSourceUpdated')
.withArgs(mockToken.address, mockAggregator.address);

It should be done using as follows:
await expect(txPromise).to.emit(contractArtifact, eventName).withArgs(...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant