Skip to content

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

Development

Successfully merging this pull request may close these issues.

this.skip causes: Cannot read property 'toString' of undefined this.skip() completely broken if html reporter used.

4 participants