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

Strenghten checks across the board for pending/skipped tests or suites #2081

Merged
merged 2 commits into from
Feb 17, 2016

Conversation

mislav
Copy link
Contributor

@mislav mislav commented Jan 28, 2016

Checking for boolean property .pending on Test or Suite objects was too brittle in a way that the caller often forgot to check whether any of the object's parents are marked as pending as well.

This moves all the pending checks to new .isPending() predicate method that is defined on all Suite and Runnable (and thus Test and Hook as well.)

Runners and reporters should always use this method to check for "pendingness" of test and suite objects.

Fixes #1760, fixes #1936

/cc @puzrin @danielstjules @Kirill89

Checking for boolean property `.pending` on Test or Suite objects was
too brittle in a way that the caller often forgot to check whether any
of the object's parents are marked as pending as well.

This moves all the pending checks to new `.isPending()` predicate method
that is defined on all Suite and Runnable (and thus Test and Hook as
well.)

Runners and reporters should always use this method to check for
"pendingness" of test and suite objects.
Users are supposed to call `this.skip()` from tests and suite hooks, so
this is definitely a public API.
@Kirill89
Copy link

It works! Thanks!
Now wait for release.

@puzrin
Copy link

puzrin commented Jan 29, 2016

Awesome!

@danielstjules
Copy link
Contributor

Thanks for all your help with this @mislav :)

danielstjules added a commit that referenced this pull request Feb 17, 2016
Strenghten checks across the board for pending/skipped tests or suites
@danielstjules danielstjules merged commit cb4248b into mochajs:master Feb 17, 2016
@mislav mislav deleted the is-pending branch February 20, 2016 05:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants