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

Add seeEvent/dontSeeEvent event assertions #173

Merged
merged 2 commits into from
Dec 20, 2023

Conversation

xEdelweiss
Copy link
Contributor

@xEdelweiss xEdelweiss commented Dec 11, 2023

Hi! This is a follow-up for #168. In this update, I've added the seeEvent/dontSeeEvent methods, which check if an event was dispatched without considering whether the listener processed it.

This approach allows the assertion to cover both orphan and non-orphan events. Therefore, this should help keep tests "green" during development, especially in scenarios where listeners might be added after the event's introduction.

Additionally, this PR consolidates assertEventTriggered and assertEventNotTriggered into a single method to reduce duplication, as the method became a bit more complex.

PR with tests.

@TavoNiievez TavoNiievez merged commit 6c8b03c into Codeception:main Dec 20, 2023
13 checks passed
@TavoNiievez TavoNiievez added this to the 3.2.0 milestone Dec 21, 2023
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 this pull request may close these issues.

2 participants