-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Mocha runner throws if test.pending is set to true in the 'test' event #4160
Comments
@karanjitsingh could you please patch following line in "lib/runner.js":
|
@karanjitsingh our CI tests haven't covered this test scenario, since they didn't fail in the past. So if you just open a PR with exactly my proposed line, our CI test have no significance, they don't prove wether the bug is fixed or not.
|
@juergba, Not sure how to test this change, if there is a test for that block of code please point me to it. Let me know if this needs to be a unit / functional test with helpful code pointers. I can confirm that the change is working for me. |
@karanjitsingh thank you. I decided to open my own PR. At the moment we do not cover programmatic usage of Mocha in our CI tests. So adding a test case for this scenario was a little more complex. |
@juergba, np. What's the release cycle for such patches for mocha on npm? |
We don't have a fix release cycle. Maybe I will give it a try this week-end. |
I have a script that hooks on to mocha events and dynamically determines which tests to run at runtime. I do this by setting
args.pending = true
in thetest
hook. 7.0.0 seems to break this behavior.Here's a sample repro
with sample
test.js
:On running this mocha throws with the error
Cannot read property 'parent' of undefined
If this is now the expected behavior how do I get around it and dynamically determine which tests to skip.
The text was updated successfully, but these errors were encountered: