mocha
mocha copied to clipboard
fix: support canonical module
Description of the Change
Handle canonicalizing Module
, prevent implicit stringification failures
Alternate Designs
- Have
canonicalType
return'object'
for modules (not chosen as that could be breaking, not sure...) - Have
'module'
fallthrough to'object'
with no custom logic (not chosen so we can indicate different between "object" and "module")
Why should this be in core?
Current module canonicalization is broken, see https://github.com/mochajs/mocha/issues/4887
Benefits
Tests can properly handle errors with a Module inside
Possible Drawbacks
Small chance there is some internal/custom handling expecting canonicalization of modules to fail... Seems unlikely?
Applicable issues
Fixes https://github.com/mochajs/mocha/issues/4887
Bug fix, patch release
The committers listed above are authorized under a signed CLA.
- :white_check_mark: login: JacobLey / name: Jacob Ley (166046234c74da1a56d07ac73e44d1940663582e, 0264c7fc7195488816320363a65dffd92b78c829)
Coverage increased (+0.005%) to 94.332% when pulling 0264c7fc7195488816320363a65dffd92b78c829 on JacobLey:canonicalModule into 023f548213e571031b41cabbcb8bb20e458b2725 on mochajs:master.
This PR hasn't had any recent activity, and I'm labeling it stale
. Remove the label or comment or this PR will be closed in 14 days. Thanks for contributing to Mocha!
Still an active issue
This PR hasn't had any recent activity, and I'm labeling it stale
. Remove the label or comment or this PR will be closed in 14 days. Thanks for contributing to Mocha!
Bump
This PR hasn't had any recent activity, and I'm labeling it stale
. Remove the label or comment or this PR will be closed in 14 days. Thanks for contributing to Mocha!
👋 coming back to this @JacobLey, are you still interested in working on this PR? As of https://github.com/mochajs/mocha/issues/5027 there are maintainers who can review it now. No worries if you no longer have time - but if you do that'd be great!
Sure, from what I can tell the commit is easily merged with latest mainline, and the solution should still be the same.
I have updated the branch, but don't believe I have power to re-open this PR.
Opened a new PR with the same commits (rebased off master): https://github.com/mochajs/mocha/pull/5040