-
-
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
🐛 Bug: when using exports interface for tests, there's no file on suites objects #5146
Comments
Thanks for filing!
This is most of the way to an MRE but:
Could you please provide a way for us to try out your issue locally? I think I get it, but really need a local reproduction to be sure. |
@JoshuaKGoldberg yeah sorry for not providing totally reproducible example. Here it goes: https://stackblitz.com/edit/stackblitz-starters-pnnurz?file=mocha-bdd-demo.js You can try running |
@JoshuaKGoldberg sorry to ping you again, but do we have any updates on this? Looks like a tiny issue to me with a ready PR, I would really appreciate if you could take a look at it. |
No update just yet - we've all been pretty swamped on the maintainer team. It's in our queue. Sorry for not having anything more specific. For context, in addition to this & other issues in triage, we've got some PR reviews to finalize (time boxed to the end of this month), as well as some administrative work going on behind-the-scenes still. |
Ok! Sorry for the delay: yes, I think this makes sense. I'll throw this in front of @mochajs/maintenance-crew just in case I'm missing something, but 👍 from me. |
Looks like all the other three mocha/lib/interfaces/common.js Lines 132 to 135 in 24560c1
See eg. Lines 41 to 47 in 24560c1
But mocha/lib/interfaces/exports.js Lines 22 to 59 in 24560c1
It does look like this was supposed to be fixed in 2015 through #1993, but it only added I wonder if it would be breaking in any way to add mocha/lib/interfaces/exports.js Lines 27 to 29 in 24560c1
(I also wonder how often mocha is used with these non-bdd interfaces) |
Answering myself somewhat: Summarizing mocharc files on sourcegraph gives that 75% specify That's probably not an exhaustive result though |
IMO it should be fine as a purely additive change. We can treat it as a minor version rather than a patch if we really want to be careful. |
Marking as accepting PRs for a semver-minor change. 🚀 |
By the way, sorry for the wait @shadowusr. I took a look at #5147 and it looks great to me - just one request for testing. Since it's been so long, I'd understand if you no longer have time for this and can add the test + merge it in a few weeks if you don't. Cheers! 🤎 |
Bug Report Checklist
faq
label, but none matched my issue.Expected
You can access the
file
field on the suite object regardless of the interface you use.Actual
file
is undefined forexports
mocha interface, but works correctly forbdd
interface.Minimal, Reproducible Example
exports
interface:suite.file
is undefined.Versions
10.2.0, 10.4.0
Additional Info
We use mocha API in on of our tools internally and this use case is crucial for us. Otherwise, we'll need to implement dirty hacks to retrieve
file
field from test objects.The text was updated successfully, but these errors were encountered: